import { NavCard } from "@/client/components/ui/nav-card"; import { PageHeader } from "@/client/components/ui/page-header"; import { Skeleton } from "@/client/components/ui/skeleton"; import { useRequireSession } from "@/client/hooks/use-auth-guard"; import { type SessionUser } from "@/client/lib/auth-client"; import { fallbackHandle } from "@/client/lib/handle"; const HUB_CARD_COUNT = 6; const AccountHubSkeleton = () => (
{Array.from({ length: HUB_CARD_COUNT }, (_, i) => (
))}
); // `/account` is the settings hub. Each card is a focused subpage that // owns one concern; the hub never edits anything inline. Adding new // surfaces (2FA, email change, delete account) means appending another // NavCard, not rearranging this page. export const AccountPage = () => { const session = useRequireSession("/account"); if (session.isPending || !session.data) { return ; } const sessionUser = session.data.user as SessionUser; const handle = sessionUser.preferredUsername ?? fallbackHandle(sessionUser); return (
{handle}} />
); };