import PatientOnboarding from "@/app/(auth)/onboarding/_patients";
import {updatePatientProfile} from "@/lib/backend/api";
import {redirect} from "next/navigation";
import {LOGIN_URL} from "@/lib/constants";
import {useAuth} from "@/lib/hooks/useAuth";

export default async function ClientsOnBoarding() {
    const {user} = await useAuth();
    if (!user) redirect(LOGIN_URL)

    return (
        <PatientOnboarding userId={user?.$id!} updatePatientProfile={updatePatientProfile}/>
    )
}