import { RootRedirect } from "@/routes/RootRedirect";
import { Login } from "@/shared/components/login/Login";
import SmartOfficeLoader from "@/shared/components/SmartOfficeLoader";
import { useAuth } from "@/shared/context/AuthContext";
import { Root } from "@radix-ui/react-slot";

export const LoginPage = () => {
  const { user, loading } = useAuth();
  if (loading) {
    return <SmartOfficeLoader label="Loading SmartOffice..." />;
  }
  if (user) {
    return <RootRedirect />;
  }
  return <Login />;
};
