import { Navigate, Outlet } from "react-router-dom";
import { useToken } from "@/contexts/TokenProvider";

export const AdminRoute = () => {
  const { isAdmin } = useToken();

  return isAdmin ? <Outlet /> : <Navigate to="/" replace />;
};
