import { CalendarCheck2, Clock, User, Car, Users, Wrench, Building2, FileText, ClipboardList, Info, ExternalLink, } from "lucide-react" import Link from "next/link" import { Card, CardContent, CardHeader, CardTitle } from "@/shared/components/ui/card" import { Badge } from "@/shared/components/ui/badge" import { Button } from "@/shared/components/ui/button" type AppointmentData = { id?: number job_card_id?: number title?: string date?: string from_time?: string to_time?: string customer_id?: number vehicle_id?: number service_writer_id?: number technician_id?: number department_id?: number notes?: string status?: string created_at?: string updated_at?: string } type AppointmentGeneralInfoProps = { appointment: AppointmentData } function InfoItem({ icon: Icon, label, value, }: { icon: React.ComponentType<{ className?: string }> label: string value?: string | number | null }) { return (
{label} {value != null && value !== "" ? String(value) : }
) } const STATUS_COLORS: Record = { requested: "bg-yellow-100 text-yellow-800", confirmed: "bg-blue-100 text-blue-800", in_progress: "bg-purple-100 text-purple-800", completed: "bg-green-100 text-green-800", cancelled: "bg-red-100 text-red-800", } export function AppointmentGeneralInfo({ appointment }: AppointmentGeneralInfoProps) { const statusClass = appointment.status ? (STATUS_COLORS[appointment.status] ?? "bg-gray-100 text-gray-800") : "bg-gray-100 text-gray-800" return (
{/* Appointment Details */} Appointment Details
{appointment.status && ( {appointment.status.replace("_", " ")} )}
{/* Customer & Vehicle */} Customer & Vehicle
{/* Assignment */} Assignment
{appointment.job_card_id && (
Job Card
)}
{/* Notes */} {appointment.notes && ( Notes

{appointment.notes}

)}
) }