import Image from "next/image"; import Link from "next/link"; import { Pencil } from "lucide-react"; import type { ReactNode } from "react"; import { Card } from "@/components/ui/card"; export interface ProfileCardProps { name: string; meta?: ReactNode; avatarUrl?: string; onEdit?: () => void; /** Renders the edit-pencil as a `` instead of a button — lets a Server Component page use the edit affordance without becoming a Client Component. Ignored if `onEdit` is also passed. */ editHref?: string; } /** Avatar + name + meta + edit-pencil pattern reused across nearly every settings/profile screen. */ export function ProfileCard({ name, meta, avatarUrl, onEdit, editHref }: ProfileCardProps) { const editButtonClassName = "flex h-10 w-10 items-center justify-center rounded-full bg-stone text-ink"; return ( {avatarUrl ? ( ) : (
{name.charAt(0)}
)}

{name}

{meta &&
{meta}
}
{onEdit ? ( ) : ( editHref && (
); }