import { Navigate, useLocation } from 'react-router-dom'; import type { ReactNode } from 'react'; import { Spin } from 'antd'; import { useAuth } from '../hooks/useAuth'; export function RequireAuth({ children }: { children: ReactNode }) { const { user, loading } = useAuth(); const location = useLocation(); if (loading) { return (