// ProtectedRoute.js
import React from "react";
import { Navigate } from "react-router-dom";
import { getToken } from "utils/tokenService";

const ProtectedRoute = ({ children }) => {
  const isAuthenticated = getToken() !== null;
  return isAuthenticated ? children : <Navigate to="/auth/login" replace />;
};

export default ProtectedRoute;