import { Navigate, Outlet } from 'react-router-dom';

export default function AuthGuard({ children }) {
  const token = localStorage.getItem('auth_token');
  
  if (!token) {
    return <Navigate to="/login" replace />;
  }

  return children || <Outlet />;
}
