import { Navigate } from "react-router";

import { useAuth } from "../hooks/useAuth.ts";

export function RestrictedGuest({ children }: { children: React.ReactNode }) {
  const { user } = useAuth();

  return user ? <Navigate to="/" /> : <>{children}</>;
}
