PageSourceSearch

https://vitori.ai/assets/DemoCustomerDetail-BoJ4dVMd.js

js vitori.ai collected 2026-10-05 14:47:11 UTC 5,727 bytes, 1 lines download raw bytes

1import{a5 as S,V as D,a as T,j as e,B as t,a6 as k,s as c,t as l,w as i,y as d,m as o,h as j,a7 as p,a8 as N,_ as B,$ as M,a0 as f,a1 as n,a2 as I,a3 as r,a4 as P,Q as z}from"./index-BReI49v3.js";function L(){const{id:g}=S(),x=D(),{getCustomerById:v,getInvoicesForCustomer:y,getOutreachForCustomer:w,simulateAction:m}=T(),a=v(g||""),u=a?y(a.id):[],h=a?w(a.id):[];if(!a)return e.jsxs("div",{className:"text-center py-12",children:[e.jsx("p",{className:"text-muted-foreground",children:"Customer not found"}),e.jsx(t,{className:"mt-4",onClick:()=>x("/demo/customers"),children:"Back to Customers"})]});const b=s=>{switch(s){case"paid":return"default";case"escalated":return"warning";case"payment_promised":return"secondary";default:return"outline"}},C=s=>s==="voice_call"?e.jsx(N,{className:"h-3 w-3"}):s==="sms"?e.jsx(j,{className:"h-3 w-3"}):e.jsx(p,{className:"h-3 w-3"});return e.jsxs("div",{className:"space-y-4",children:[e.jsxs(t,{variant:"ghost",onClick:()=>x("/demo/customers"),className:"gap-2",children:[e.jsx(k,{className:"h-4 w-4"})," Back to Customers"]}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsxs(c,{children:[e.jsx(l,{children:e.jsx(i,{children:a.name})}),e.jsxs(d,{className:"space-y-3",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-muted-foreground",children:"Email"}),e.jsx("span",{children:a.email})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-muted-foreground",children:"Phone"}),e.jsx("span",{children:a.phone})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-muted-foreground",children:"Company"}),e.jsx("span",{children:a.company_name||"-"})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-muted-foreground",children:"Location"}),e.jsxs("span",{children:[a.city,", ",a.state]})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-muted-foreground",children:"Preferred Channel"}),e.jsx(o,{variant:"outline",className:"capitalize",children:a.preferred_contact_channel})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-muted-foreground",children:"Payment Score"}),e.jsxs("span",{children:[a.payment_history_score,"/100"]})]})]})]}),e.jsxs(c,{children:[e.jsx(l,{children:e.jsx(i,{children:"Account Summary"})}),e.jsxs(d,{className:"space-y-3",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-muted-foreground",children:"Outstanding"}),e.jsxs("span",{className:"text-xl font-bold",children:["$",a.total_outstanding.toLocaleString()]})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-muted-foreground",children:"Total Paid"}),e.jsxs("span",{className:"text-lg",children:["$",a.total_paid.toLocaleString()]})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-muted-foreground",children:"Invoices"}),e.jsx("span",{children:u.length})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-muted-foreground",children:"Outreach Attempts"}),e.jsx("span",{children:h.length})]}),e.jsxs("div",{className:"flex gap-2 pt-2",children:[e.jsxs(t,{size:"sm",variant:"outline",onClick:()=>m("Sending SMS..."),className:"gap-1",children:[e.jsx(j,{className:"h-3 w-3"})," SMS"]}),e.jsxs(t,{size:"sm",variant:"outline",onClick:()=>m("Sending email..."),className:"gap-1",children:[e.jsx(p,{className:"h-3 w-3"})," Email"]}),e.jsxs(t,{size:"sm",variant:"outline",onClick:()=>m("Executing call..."),className:"gap-1",children:[e.jsx(N,{className:"h-3 w-3"})," Call"]})]})]})]})]}),e.jsxs(c,{children:[e.jsx(l,{children:e.jsx(i,{children:"Invoices"})}),e.jsx(d,{className:"overflow-x-auto",children:e.jsxs(B,{children:[e.jsx(M,{children:e.jsxs(f,{children:[e.jsx(n,{children:"Invoice #"}),e.jsx(n,{children:"Amount"}),e.jsx(n,{children:"Due Date"}),e.jsx(n,{children:"Days Overdue"}),e.jsx(n,{children:"Status"})]})}),e.jsx(I,{children:u.map(s=>e.jsxs(f,{className:"cursor-pointer hover:bg-muted/50",onClick:()=>x(`/demo/invoices/${s.id}`),children:[e.jsx(r,{className:"font-medium text-primary",children:s.invoice_number}
1),e.jsxs(r,{children:["$",s.amount_due.toLocaleString()]}),e.jsx(r,{children:P(new Date(s.due_date),"MMM dd, yyyy")}),e.jsx(r,{className:s.days_overdue>30?"text-destructive":"",children:s.days_overdue||"-"}),e.jsx(r,{children:e.jsx(o,{variant:b(s.status),children:s.status.replace(/_/g," ")})})]},s.id))})]})})]}),e.jsxs(c,{children:[e.jsx(l,{children:e.jsx(i,{children:"Outreach History"})}),e.jsx(d,{children:h.length===0?e.jsx("p",{className:"text-center text-muted-foreground py-4",children:"No outreach history"}):e.jsx("div",{className:"space-y-3",children:h.sort((s,_)=>new Date(_.created_at).getTime()-new Date(s.created_at).getTime()).map(s=>e.jsxs("div",{className:"flex items-start gap-3 pb-3 border-b border-border last:border-0",children:[e.jsx("div",{className:"mt-1",children:C(s.channel)}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(o,{variant:"outline",className:"text-xs capitalize",children:s.channel==="voice_call"?"Call":s.channel}),s.sentiment&&e.jsx(o,{variant:s.sentiment==="positive"?"default":s.sentiment==="negative"?"destructive":"secondary",className:"text-xs",children:s.sentiment})]}),e.jsx("p",{className:"text-sm text-muted-foreground truncate",children:s.message_preview})]}),e.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:z(new Date(s.created_at),{addSuffix:!0})})]},s.id))})})]})]})}export{L 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.