"use client"; import { Flex, Spinner } from "@chakra-ui/react"; import useAuthReady from "../lib/useAuthReady"; export default function AuthWrapper({ children, }: { children: React.ReactNode; }) { const { isAuthReady, isLoading } = useAuthReady(); // Show spinner while auth is loading if (isLoading || !isAuthReady) { return ( ); } return <>{children}; }