fix: Remove unused import in ProtectedRoute (Refs #2)
This commit is contained in:
@@ -1,14 +1,15 @@
|
||||
import { Navigate, Outlet } from 'react-router-dom';
|
||||
import { Navigate } from 'react-router-dom';
|
||||
import { useAuth } from '../hooks/useAuth';
|
||||
import type { PropsWithChildren } from 'react';
|
||||
|
||||
const ProtectedRoute = () => {
|
||||
const ProtectedRoute = ({ children }: PropsWithChildren<{}>) => {
|
||||
const { isAuthenticated } = useAuth();
|
||||
|
||||
if (!isAuthenticated) {
|
||||
return <Navigate to="/login" replace />;
|
||||
}
|
||||
|
||||
return <Outlet />;
|
||||
return children;
|
||||
};
|
||||
|
||||
export default ProtectedRoute;
|
||||
Reference in New Issue
Block a user