import { Navigate, Outlet, useLocation } from 'react-router-dom' import { useAuth } from '@/features/auth/useAuth' /** Пропускает дальше только аутентифицированных; остальных отправляет на /login. */ export function ProtectedRoute() { const { status } = useAuth() const location = useLocation() if (status === 'loading') { return (
) } if (status === 'unauthenticated') { return } return }