import { Navigate } from 'react-router-dom';
import { useAuth } from '@/context/AuthContext';

export default function ProtectedRoute({ children }: any) {
	const { token } = useAuth();

	if (!token) {
		return <Navigate to="/" />;
	}

	return children;
}
