import { Navigate, useLocation } from 'react-router-dom'; import { useAppSelector } from '../store/hooks'; import { selectIsAuthenticated } from '../store/slices/authSlice'; export default function RequireAuth({ children }: { children: React.ReactNode }) { const isAuth = useAppSelector(selectIsAuthenticated); const location = useLocation(); if (!isAuth) { return ; } return <>{children}; }