import { Navigate } from 'react-router-dom'; import { useAuth } from '../context/auth-context.jsx'; export function ProtectedRoute({ children }) { const { user, ready } = useAuth(); if (!ready) return null; if (!user) return ; return children; }