1import{k as g,j as e}from"./vendor-react-BZE6wSbZ.js";import{u as h}from"./useLocaleFormat-D7hA3WYI.js";import{u as f,c as d,L as b}from"./index-BHxCMQCy.js";import{C as j}from"./camera-CZyd59eF.js";import"./vendor-shared-BX-e1btJ.js";import"./useCompanyCurrency-DsQ7Wf_J.js";function C(){var l;const{truck:s,triggerUpload:u,uploading:m}=g(),{t:r}=f();h();const i=typeof s.documents_json=="object"&&s.documents_json||{},n=typeof s.photos_json=="object"&&s.photos_json||{},x=["front","right","left","rear"].filter(t=>!!n[t]).length,p=[{key:"registration",label:r("truckOverview.registration")},{key:"insurance",label:r("truckOverview.insurance")},{key:"odometer",label:r("truckOverview.odometer")}],v=[{key:"front",label:r("truckOverview.sideFront")},{key:"right",label:r("truckOverview.sideRight")},{key:"left",label:r("truckOverview.sideLeft")},{key:"rear",label:r("truckOverview.sideRear")}];return e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"rounded-xl border border-border bg-card p-5 shadow-[0_1px_3px_0_hsl(var(--foreground)/0.04)]",children:[e.jsx("h3",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wider mb-4",children:r("truckOverview.truckInformation")}),e.jsx("div",{className:"grid grid-cols-2 gap-y-4 gap-x-8",children:[[r("truckOverview.model"),s.model],[r("truckOverview.licensePlate"),s.plate],[r("truckOverview.vin"),s.vin],[r("truckOverview.year"),(l=s.year)==null?void 0:l.toString()],[r("truckOverview.color"),s.color],[r("truckOverview.manufacturer"),s.manufacturer],[r("truckOverview.mileage"),s.mileage?`${s.mileage.toLocaleString()} ${r("truckOverview.mileageUnit")}`:null]].map(([t,o])=>e.jsxs("div",{children:[e.jsx("p",{className:"text-[11px] text-muted-foreground uppercase tracking-wider",children:t}),e.jsx("p",{className:"text-sm font-medium text-foreground mt-0.5",children:o||"â"})]},t))})]}),e.jsxs("div",{className:"rounded-xl border border-border bg-card p-5 shadow-[0_1px_3px_0_hsl(var(--foreground)/0.04)]",children:[e.jsx("h3",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wider mb-4",children:r("truckOverview.documentStatus")}),e.jsx("div",{className:"space-y-2",children:p.map(({key:t,label:o})=>e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:d("w-2 h-2 rounded-full",i[t]?"bg-emerald-500":"bg-amber-400")}),e.jsx("span",{className:"text-sm text-foreground",children:o}),e.jsx("span",{className:d("text-[11px] ml-auto",i[t]?"text-emerald-600":"text-amber-600"),children:i[t]?r("truckOverview.uploaded"):r("truckOverview.missing")})]},t))})]}),e.jsxs("div",{className:"rounded-xl border border-border bg-card p-5 shadow-[0_1px_3px_0_hsl(var(--foreground)/0.04)]",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("h3",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wider",children:r("truckOverview.photos")}),e.jsx("span",{className:"text-[11px] text-muted-foreground",children:r("truckOverview.uploadedCount",{count:x})})]}),e.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3",children:v.map(({key:t,label:o})=>{const c=n[t]||null,a=m===t;return e.jsx("div",{onClick:()=>!a&&u("photos",t),className:d("aspect-[4/3] rounded-xl border-2 border-dashed flex flex-col items-center justify-center cursor-pointer transition-colors overflow-hidden",c?"border-transparent":"border-border hover:border-primary/40 hover:bg-primary/[0.02]",a&&"pointer-events-none opacity-60"),children:c?e.jsx("img",{src:c,alt:o,className:"w-full h-full object-cover rounded-xl"}):e.jsxs(e.Fragment,{children:[a?e.jsx(b,{className:"w-6 h-6 text-primary animate-spin mb-2"}):e.jsx(j,{className:"w-6 h-6 text-muted-foreground mb-2"}),e.jsx("p",{className:"text-xs font-medium text-foreground",children:o}),e.jsx("p",{className:"text-[10px] text-muted-foreground",children:r(a?"truckOverview.uploading":"truckOverview.clickToUpload")})]})},t)})})]})]})}export{C as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.