"use client"; import { CalendarClock, CalendarDays, Clock, Plus, Stethoscope, Users, } from "lucide-react"; import { type ReactNode, useState } from "react"; import { AddAppointmentDialog, type NewAppointment, } from "@/components/appointments/add-appointment-dialog"; import { CalendarDialog } from "@/components/appointments/calendar-dialog"; import { Avatar, AvatarFallback } from "@/components/ui/avatar"; import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; import { Card } from "@/components/ui/card"; // All figures here are mock/placeholder data — there is no scheduling backend. // They illustrate the Appointments & Schedule layout. type ApptStatus = "confirmed" | "checked-in" | "completed" | "cancelled"; export type Appointment = { time: string; name: string; initials: string; type: string; provider: string; status: ApptStatus; }; const statusVariant: Record< ApptStatus, "default" | "secondary" | "destructive" | "outline" > = { "checked-in": "default", confirmed: "secondary", completed: "outline", cancelled: "destructive", }; const statusLabel: Record = { "checked-in": "Checked in", confirmed: "Confirmed", completed: "Completed", cancelled: "Cancelled", }; const kpis = [ { label: "Today", value: "12", icon: CalendarClock }, { label: "This week", value: "146", icon: Users }, { label: "Avg. visit", value: "22 min", icon: Clock }, { label: "Utilization", value: "87%", icon: Stethoscope }, ]; const today: Appointment[] = [ { time: "09:00", name: "Amina Yusuf", initials: "AY", type: "Follow-up", provider: "Dr. Okafor", status: "completed", }, { time: "09:30", name: "Daniel Mensah", initials: "DM", type: "New patient", provider: "Dr. Okafor", status: "checked-in", }, { time: "10:15", name: "Leila Haddad", initials: "LH", type: "Lab review", provider: "Dr. Stein", status: "confirmed", }, { time: "11:00", name: "Carlos Rivera", initials: "CR", type: "Consultation", provider: "Dr. Okafor", status: "confirmed", }, { time: "13:30", name: "Priya Nair", initials: "PN", type: "Follow-up", provider: "Dr. Stein", status: "cancelled", }, { time: "14:45", name: "Tom Becker", initials: "TB", type: "Vaccination", provider: "Dr. Okafor", status: "confirmed", }, ]; const upcoming: { day: string; items: Appointment[] }[] = [ { day: "Tomorrow", items: [ { time: "08:45", name: "Grace Lin", initials: "GL", type: "Follow-up", provider: "Dr. Stein", status: "confirmed", }, { time: "10:00", name: "Omar Farouk", initials: "OF", type: "New patient", provider: "Dr. Okafor", status: "confirmed", }, ], }, ]; function Kpi({ label, value, icon: Icon, }: { label: string; value: string; icon: typeof CalendarClock; }) { return (
{label} {value}
); } function ApptRow({ appt }: { appt: Appointment }) { return (
{appt.time} {appt.initials}
{appt.name} {appt.type} · {appt.provider}
{statusLabel[appt.status]}
); } export function ScheduleList({ items }: { items: Appointment[] }) { return (
{items.map((appt) => ( ))}
); } function Section({ title, description, children, }: { title: string; description?: string; children: ReactNode; }) { return (

{title}

{description && (

{description}

)}
{children}
); } export function AppointmentsView() { const [addOpen, setAddOpen] = useState(false); const [calendarOpen, setCalendarOpen] = useState(false); const [schedule, setSchedule] = useState(today); // Insert a new (mock) appointment into today's schedule, kept time-sorted. const addAppointment = (appt: NewAppointment) => { setSchedule((prev) => [...prev, { ...appt, status: "confirmed" as const }].sort((a, b) => a.time.localeCompare(b.time), ), ); }; return (

Appointments & Schedule

Today's clinic schedule and what's coming up. Sample data.

{kpis.map((k) => ( ))}
{upcoming.map((group) => (
))}
); }