import { Avatar, AvatarFallback } from "./avatar"; import { Button } from "./button"; import type { AppointmentStatus } from "./appointment-time-slot-picker"; // Re-export so consumers who import AppointmentStatus from this module still work export type { AppointmentStatus } from "./appointment-time-slot-picker"; // --------------------------------------------------------------------------- // Types // --------------------------------------------------------------------------- export interface AppointmentMiniCardItem { id: string; status: AppointmentStatus; clientName: string; clientAvatarInitials: string; /** ISO date string — "2026-04-22" */ date: string; /** Display time — "10:00 AM" */ timeStart: string; /** Display time — "10:30 AM" */ timeEnd: string; } export interface AppointmentMiniCardProps { appointment: AppointmentMiniCardItem; onAccept?: () => void; onDecline?: () => void; onReschedule?: () => void; } // --------------------------------------------------------------------------- // Status styling // --------------------------------------------------------------------------- const STATUS_BG: Record = { pending: "border-warning bg-warning/10", confirmed: "border-success bg-success/10", cancelled: "border-destructive bg-destructive/10 opacity-60", rescheduled: "border-info bg-info/10", }; // --------------------------------------------------------------------------- // Component // --------------------------------------------------------------------------- export function AppointmentMiniCard({ appointment, onAccept, onDecline, onReschedule, }: AppointmentMiniCardProps) { const isConfirmed = appointment.status === "confirmed"; const isRescheduled = appointment.status === "rescheduled"; const isCancelled = appointment.status === "cancelled"; return (
{appointment.clientAvatarInitials}

{appointment.clientName}

{appointment.date} · {appointment.timeStart} – {appointment.timeEnd}

{/* Always 3 buttons — enabled state varies by status */}
); }