import { getSession } from "@/lib/auth/session"
import { PasskeyAdd } from "../_components/passkey"
import PasskeysList from "../_components/passkeys-list"
import UserProfile from "../_components/user-profile"

export default async function UserPage() {
    const { session, redirect } = await getSession()

    if (!session) {
        redirect("/login")
    }

    return (
        <div className="p-6">
            <div className="pb-6">
                <h1 className="block mb-2 text-2xl font-bold text-foreground">User Profile</h1>
                <h1 className="block text-muted-foreground">Manage user settings</h1>
            </div>
            <div className="flex flex-col gap-6">
                <UserProfile />
                <PasskeyAdd />
                <PasskeysList />
            </div>
        </div>
    )
}
