import { FileText, Hash, Calendar, User, Car, Building2, Shield, Tag, MessageSquare, } from "lucide-react" import { Card, CardContent, CardHeader, CardTitle, } from "@/shared/components/ui/card" import { Badge } from "@/shared/components/ui/badge" import { formatDate } from "@/shared/utils/formatters" type EstimateData = { id?: number title?: string estimate_number?: string date?: string customer_id?: number vehicle_id?: number department_id?: number has_insurance?: boolean enable_digital_authorisation?: boolean insurance_type_id?: string | number | null insurer_id?: string | number | null service_writer_id?: number footer?: string | null created_at?: string updated_at?: string labels?: { id?: number title?: string color_code?: string }[] customer_remarks?: { id?: number remark?: string created_at?: string }[] // Nested relation objects from the API customer?: { id?: number; first_name?: string; last_name?: string } vehicle?: { id?: number; registration_number?: string; make?: string; model?: string } department?: { id?: number; name?: string } insurance_type?: { id?: number; title?: string } insurer?: { id?: number; first_name?: string; last_name?: string } service_writer?: { id?: number; first_name?: string; last_name?: string } } type EstimateGeneralInfoProps = { estimate: EstimateData } function InfoItem({ icon: Icon, label, value, }: { icon: React.ComponentType<{ className?: string }> label: string value?: string | null }) { return (
{label} {value || }
) } export function EstimateGeneralInfo({ estimate }: EstimateGeneralInfoProps) { return (
{estimate?.labels?.map((label) => ( {label.title} ))}
Estimate Details
Related Records {estimate.customer_remarks && estimate.customer_remarks.length > 0 && ( Customer Remarks {estimate.customer_remarks.map((remark) => (

{remark.remark}

{remark.created_at && (

{new Date(remark.created_at).toLocaleDateString()}

)}
))}
)} {estimate.footer && ( Footer

{estimate.footer}

)}
) }