import{j as t}from"./vendor-react-DrAK5R0M.js";import{b as x}from"./CrmWidgets-CPIn4fPO.js";import{h as p}from"./index-7eqLqzhB.js";import{j as f}from"./vendor-icons-Cu2Ube6F.js";const l={connected:"hsl(152, 55%, 42%)",positive:"hsl(152, 55%, 42%)",voicemail:"hsl(38, 92%, 50%)",neutral:"hsl(38, 92%, 50%)",follow_up_needed:"hsl(38, 92%, 50%)",negative:"hsl(var(--destructive))",no_show:"hsl(var(--destructive))"},h={contact:"contact",account:"account",opportunity:"opportunity",use_case:"use-case"};function y({activities:s,emptyMessage:d="No activity yet."}){const{openDrawer:c}=p();return s.length===0?t.jsx("p",{className:"text-sm text-muted-foreground",children:d}):t.jsx("div",{className:"space-y-1",children:s.map((e,a)=>{const m=e.description??e.body??e.note??e.subject??"",o=e.occurred_at??e.created_at??"",r=e.subject_type&&e.subject_id,n=r||!!e.contact_id,u=()=>{if(r){const i=h[e.subject_type];i&&c(i,e.subject_id)}else e.contact_id&&c("contact",e.contact_id)};return t.jsxs("div",{className:`flex gap-3 py-2 ${n?"cursor-pointer hover:bg-muted/40 rounded-xl px-2 -mx-2 transition-colors":""}`,onClick:n?u:void 0,children:[t.jsx("div",{className:"w-7 h-7 rounded-xl bg-muted flex items-center justify-center text-muted-foreground flex-shrink-0 mt-0.5",children:x(e.type)}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsxs("div",{className:"flex items-start gap-2",children:[t.jsx("p",{className:"text-sm text-foreground flex-1 min-w-0 truncate",children:m||e.type}),e.outcome&&t.jsx("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded-md text-xs font-medium capitalize flex-shrink-0",style:{backgroundColor:(l[e.outcome]??"hsl(var(--muted-foreground))")+"18",color:l[e.outcome]??"hsl(var(--muted-foreground))"},children:e.outcome.replace(/_/g," ")})]}),t.jsxs("div",{className:"flex items-center gap-1.5 mt-0.5 flex-wrap",children:[e.performer_name&&t.jsxs("span",{className:"inline-flex items-center gap-0.5 text-xs text-muted-foreground",children:[t.jsx(f,{className:"w-2.5 h-2.5"}),e.performer_name]}),t.jsx("span",{className:"text-xs text-muted-foreground",children:o?new Date(o).toLocaleDateString():""})]})]})]},e.id??a)})})}export{y as A};
