"use client"; import * as React from "react"; import { cn } from "./lib/utils"; export interface ProfileSettingsProps extends React.HTMLAttributes { name?: string; email?: string; initials?: string; onSave?: (data: { name: string; email: string }) => void; onDelete?: () => void; } /** Profile settings page: avatar + personal info + danger zone. */ export function ProfileSettings({ name = "Ada Lovelace", email = "ada@mail.com", initials = "AL", onSave, onDelete, className, ...props }: ProfileSettingsProps) { const [n, setN] = React.useState(name); const [e, setE] = React.useState(email); const [confirmDelete, setConfirmDelete] = React.useState(false); return (
{initials}

{n}

{e}

setN(ev.target.value)} className="w-full rounded-md border border-input bg-background px-3 py-2 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring transition-colors motion-reduce:transition-none" />
setE(ev.target.value)} className="w-full rounded-md border border-input bg-background px-3 py-2 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring transition-colors motion-reduce:transition-none" />
{/* Danger zone */}

Danger Zone

Permanently delete your account. This action cannot be undone.

{!confirmDelete ? ( ) : (
)}
); }