import React from "react";
import { Navigate } from "react-router-dom";

const GuestRoute = ({ children }) => {
  const isAuthenticated = !!localStorage.getItem('token'); // Mengecek token
  return isAuthenticated ? <Navigate to="/home" /> : children;
};

export default GuestRoute;
