import{bq as x,br as m,a9 as p,b as e,C as E,B as n,s,j as a,J as g,c0 as v}from"./index-BiWH3VAt.js";import{d as _}from"./History-CPUIVW6I.js";import{d as C}from"./PersonAdd-C0OLRgDd.js";import{d as S}from"./AttachFile-DKeeTIfh.js";import{d as A}from"./TrendingUp-BlGfjh5P.js";import{d as D}from"./InfoOutlined-B1hN9_YE.js";import{d as T}from"./Cancel-CXYVufRT.js";var c={},b=x;Object.defineProperty(c,"__esModule",{value:!0});var l=c.default=void 0,R=b(m()),$=p;l=c.default=(0,R.default)((0,$.jsx)("path",{d:"M17 10H7v2h10zm2-7h-1V1h-2v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m0 16H5V8h14zm-5-5H7v2h7z"}),"EventNote");function j(t){return t==="QC_APPROVED"?e(v,{sx:{fontSize:18}}):t==="QC_REJECTED"?e(T,{sx:{fontSize:18}}):t==="STATUS_CHANGED"?e(_,{sx:{fontSize:18}}):t==="ASSIGNED"?e(C,{sx:{fontSize:18}}):t.startsWith("FOLLOW_UP")?e(l,{sx:{fontSize:18}}):t.startsWith("ATTACHMENT")?e(S,{sx:{fontSize:18}}):t==="LEAD_CREATED"?e(A,{sx:{fontSize:18}}):e(D,{sx:{fontSize:18}})}function z(t){return t==="QC_APPROVED"?"#2e7d32":t==="QC_REJECTED"?"#d32f2f":t==="STATUS_CHANGED"?"#7b1fa2":t==="ASSIGNED"?"#196ae5":t.startsWith("FOLLOW_UP")?"#22bb34":t.startsWith("ATTACHMENT")?"#ef6c00":t==="LEAD_CREATED"?"#00880f":"#757575"}function P(t){const{payload:r}=t;if(t.type==="QC_APPROVED"||t.type==="QC_REJECTED"){const i=[];return r!=null&&r.checklist&&i.push(`Checklist: ${String(r.checklist)}`),t.type==="QC_REJECTED"&&(r!=null&&r.reason&&i.push(`Reason: ${String(r.reason)}`),r!=null&&r.disposition&&i.push(`Disposition: ${String(r.disposition)}`),r!=null&&r.vendor&&i.push(`Vendor: ${String(r.vendor)}`)),i.length?i.join(" · "):t.type==="QC_APPROVED"?"QC approved":"QC rejected"}if(!r)return t.type.replace(/_/g," ");if(r.from!==void 0&&r.to!==void 0)return`Changed from ${String(r.from)} to ${String(r.to)}`;const o=JSON.stringify(r);return o.length>120?`${o.slice(0,117)}...`:o}const L=({entries:t,loading:r=!1,emptyText:o="No activity yet."})=>r?e(n,{display:"flex",justifyContent:"center",py:4,children:e(E,{size:32})}):t.length===0?e(n,{py:4,textAlign:"center",children:e(s,{variant:"body2",color:"text.secondary",children:o})}):e(n,{children:t.map((i,u)=>{const f=z(i.type),h=j(i.type),d=u===t.length-1;return a(n,{display:"flex",gap:1.5,children:[a(n,{display:"flex",flexDirection:"column",alignItems:"center",width:36,flexShrink:0,children:[e(n,{sx:{width:36,height:36,borderRadius:"50%",bgcolor:`${f}18`,border:`1.5px solid ${f}40`,display:"flex",alignItems:"center",justifyContent:"center",color:f,flexShrink:0},children:h}),!d&&e(n,{sx:{width:2,flex:1,minHeight:24,bgcolor:"divider",my:.5}})]}),a(n,{pb:d?0:2.5,flex:1,minWidth:0,children:[a(n,{display:"flex",alignItems:"center",flexWrap:"wrap",gap:1,mb:.25,children:[e(s,{variant:"caption",fontWeight:700,color:f,children:i.type.replace(/_/g," ")}),i.actor&&a(s,{variant:"caption",color:"text.secondary",children:["· ",i.actor]}),e(s,{variant:"caption",color:"text.disabled",ml:"auto",children:i.occurredAt?g(i.occurredAt):"—"})]}),e(s,{variant:"body2",color:"text.secondary",sx:{wordBreak:"break-word"},children:P(i)})]})]},i.id)})});export{L as A};
