"use client";
import { useEffect, useState } from "react";

export default function ClientOnlyWrapper({
  children,
}: {
  children: React.ReactNode;
}) {
  const [hasMounted, setHasMounted] = useState(false);

  useEffect(() => {
    setHasMounted(true);
  }, []);

  if (!hasMounted) {
    return (
      <div className="min-h-[400px] animate-pulse bg-gray-100 dark:bg-gray-800" />
    );
  }

  return <>{children}</>;
}
