import Image from "next/image"; import { Gift, NotebookText } from "lucide-react"; import type { ReactNode } from "react"; import { Card } from "@/components/ui/card"; import { StatusPill } from "@/components/ui/status-pill"; import type { AppointmentStatus, StaffSummary } from "@/types/domain"; export interface AppointmentCardProps { status: AppointmentStatus; serviceName: string; /** The other party shown on the card — the barber on a customer-facing card, the customer on a staff-facing one. Same {id, name, avatarUrl} shape either way. */ person: StaffSummary; /** Defaults to "with" — a staff card might prefer e.g. "for". */ personLabel?: string; /** Pre-formatted for display, e.g. "Sat, Oct 12" — omit when the surrounding page already makes the date clear (e.g. a single day's agenda). */ formattedDate?: string; /** Pre-formatted for display, e.g. "2:00 PM". */ formattedTime: string; /** Small notes-exist indicator — staff calendar/agenda use, customer cards leave this unset. */ hasNotes?: boolean; /** Small loyalty-reward-available indicator — same. */ hasAvailableReward?: boolean; /** Reschedule/Cancel/Book again buttons — left to the caller so this * component stays agnostic of which actions apply to which status. */ actions?: ReactNode; href?: string; } export function AppointmentCard({ status, serviceName, person, personLabel = "with", formattedDate, formattedTime, hasNotes, hasAvailableReward, actions, }: AppointmentCardProps) { return (
{formattedDate &&

{formattedDate}

}

{formattedTime}

{person.avatarUrl ? ( ) : (
{person.name.charAt(0)}
)}

{serviceName}

{hasNotes && ( )} {hasAvailableReward && ( )}

{personLabel} {person.name}

{actions &&
{actions}
}
); }