import { Navigate, useLocation } from 'react-router-dom' import { useAppSelector } from '../hooks' import { appPublicRoutes } from '.' export function PrivateRoute({ children }: { children: JSX.Element }) { const location = useLocation() const isLoggedIn = useAppSelector((state) => state.auth?.loggedIn) if (!isLoggedIn) { return ( ) } return children }