1import{c as g,E as p,a2 as _,M as j,T as v,a4 as k,j as e,ah as N,g as b,_ as i,B as h,f as C,D as f,b6 as y,a3 as S,a as u,Z as O,b7 as w,a6 as m}from"./index-DmmRUugt.js";/** 2 * @license lucide-react v0.462.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */const P=g("PackageCheck",[["path",{d:"m16 16 2 2 4-4",key:"gfu2re"}],["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}]]),x={call:{label:"Call",color:"hsl(var(--primary))",icon:"Phone"},delivery:{label:"Delivery",color:"hsl(142 76% 36%)",icon:"Truck"},pickup:{label:"Pickup",color:"hsl(25 95% 53%)",icon:"PackageCheck"},followup:{label:"Follow-up",color:"hsl(221 83% 53%)",icon:"MessageSquare"},onsite_estimate:{label:"On-site Estimate",color:"hsl(262 83% 58%)",icon:"MapPin"},other:{label:"Other",color:"hsl(var(--muted-foreground))",icon:"Calendar"}},M={scheduled:{label:"Scheduled",color:"hsl(var(--primary))"},completed:{label:"Completed",color:"hsl(142 76% 36%)"},cancelled:{label:"Cancelled",color:"hsl(var(--muted-foreground))"}},E={Phone:k,Truck:v,PackageCheck:P,MessageSquare:j,MapPin:_,Calendar:p};function T({item:s,onComplete:c,onViewLead:a,isPending:n}){const r=x[s.item_type]||x.other,o=E[r.icon]||p;return e.jsxs("div",{className:`flex items-center gap-3 p-2.5 rounded-lg border transition-colors cursor-pointer hover:bg-muted/50 ${s.is_overdue?"border-amber-200 bg-amber-50/50 dark:bg-amber-950/20 dark:border-amber-900":"border-border bg-muted/30"}`,onClick:()=>a&&s.lead_id&&a(s.lead_id),children:[e.jsx("div",{className:`p-1.5 rounded-md shrink-0 ${s.is_overdue?"bg-amber-100 text-amber-700 dark:bg-amber-900 dark:text-amber-400":"bg-background text-muted-foreground border border-border"}`,style:s.is_overdue?void 0:{backgroundColor:`${r.color}15`,color:r.color,borderColor:`${r.color}30`},children:e.jsx(o,{className:"h-4 w-4"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:`font-medium text-sm truncate ${s.is_overdue?"text-amber-800 dark:text-amber-400":""}`,children:r.label}),s.is_overdue&&e.jsx(N,{variant:"secondary",className:"h-4 text-[10px] px-1 bg-amber-100 text-amber-700 border-amber-200",children:"Overdue"})]}),e.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground mt-0.5",children:[e.jsx(b,{className:"h-3 w-3"}),e.jsx("span",{children:s.scheduled_time?i(new Date(`2000-01-01T${s.scheduled_time}`),"h:mm a"):"All Day"}),s.notes&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"â¢"}),e.jsx("span",{className:"truncate max-w-[150px]",children:s.notes})]})]})]}),e.jsx(h,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-green-600 hover:bg-green-50",onClick:l=>c(s.id,l),disabled:n,children:e.jsx(C,{className:"h-4 w-4"})})]})}const I={scheduled:u,on_my_way:S,in_progress:y,completed:f},R={scheduled:"#3b82f6",on_my_way:"#f97316",in_progress:"#eab308",completed:"#22c55e"};function B({item:s,onAction:c,onViewLead:a,isPending:n}){const r=I[s.job_progress||"scheduled"]||u,o=R[s.job_progress||"scheduled"]||"currentColor",l=O[s.job_progress]||null;let d="Scheduled";return s.scheduled_at?d=i(new Date(s.scheduled_at),"h:mm a"):s.delivery_date&&(d=i(new Date(s.delivery_date),"MMM d")),e.jsxs("div",{className:"flex items-center gap-3 p-2.5 rounded-lg border border-border bg-card transition-colors cursor-pointer hover:border-primary/20 hover:shadow-sm",onClick:()=>a&&a(s.id),children:[e.jsx("div",{className:"p-2 rounded-md shrink-0 bg-primary/10 text-primary",style:{backgroundColor:`${o}15`,color:o},children:e.jsx(r,{className:"h-4 w-4"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"font-medium text-sm truncate",children:[s.first_name," ",s.last_name]}),e.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground mt-0.5",children:[e.jsx("span",{className:"font-medium",style:{color:o},children:w[s.job_progress]||s.job_progress}),e.jsx("span",{children:"â¢"}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(b,{className:"h-3 w-3"}),e.jsx("span",{children:d})]}),s.dumpster_size&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"â¢"}),e.jsx("span",{children:s.dumpster_size.replace("_"," ")})]})]})]}),e.jsx("div",{onClick:t=>t.stopPropagation(),className:"flex items-center gap-1 shrink-0",children:l?e.jsxs(h,{variant:"ghost",size:"sm",className:"h-7 text-xs gap-1 hover:bg-primary/5",onClick:t=>c(s.id,l.next,t),disabled:n,children:[e.jsx("span",{className:"hidden sm:inline",children:l.label}),e.jsx("span",{className:"sm:hidden",children:l.label.split(" ")[0]}),e.jsx(m,{className:"h-3 w-3"})]}):e.jsx(h,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>a&&a(s.id),children:e.jsx(m,{className:"h-4 w-4"})})})]})}export{B as J,P,x as S,T,M as a};
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.