PageSourceSearch

https://cordiva.ai/assets/Calls-SfAYyyhf.js

js cordiva.ai collected 2026-10-05 14:56:06 UTC 2,622 bytes, 1 lines download raw bytes

1import{aM as _,aK as w,aA as d,aB as m,aC as N,ay as s,C as S,m as u,k,n as y,q as T,r as B,o as $}from"./index-C7spqnBO.js";import{T as A,d as D,e as x,c as r,a as H,b as c}from"./table-Dhciyv7r.js";import{B as L}from"./badge-DVCliIyW.js";function I(){const l=_(),{t:a}=w(),[h,j]=d.useState([]),[f,g]=d.useState(!0);d.useEffect(()=>{p(),b()},[]);const p=async()=>{const{data:{session:e}}=await m.auth.getSession();e||l("/crm/auth")},b=async()=>{var e;try{const{data:{session:t}}=await m.auth.getSession();if(!t)return;const n=sessionStorage.getItem("mirroredUserId"),i=n?`retell-calls?client_user_id=${n}`:"retell-calls",o=await m.functions.invoke(i,{headers:{Authorization:`Bearer ${t.access_token}`}});if(o.error)throw o.error;j(((e=o.data)==null?void 0:e.calls)||[])}catch(t){N({title:a("crm.auth.error"),description:t.message,variant:"destructive"})}finally{g(!1)}},C=e=>{const t=Math.floor(e/1e3),n=Math.floor(t/60),i=t%60;return`${n}:${i.toString().padStart(2,"0")}`},v=e=>{switch(e){case"completed":return"default";case"failed":return"destructive";case"ongoing":return"secondary";default:return"outline"}};return s.jsxs("div",{className:"min-h-screen bg-background",children:[s.jsx(S,{}),s.jsxs("main",{className:"container mx-auto px-4 py-8",children:[s.jsxs(u,{variant:"ghost",onClick:()=>l("/crm/dashboard"),className:"mb-4 -ml-2",children:[s.jsx(k,{className:"h-4 w-4 mr-2"}),"Back to Dashboard"]}),s.jsx("h1",{className:"text-3xl font-bold mb-8",children:a("crm.calls.title")}),s.jsxs(y,{children:[s.jsx(T,{children:s.jsx(B,{children:a("crm.calls.recent")})}),s.jsx($,{children:f?s.jsx("p",{children:a("crm.calls.loading")}):h.length===0?s.jsx("p",{className:"text-muted-foreground",children:a("crm.calls.noRecords")}):s.jsxs(A,{children:[s.jsx(D,{children:s.jsxs(x,{children:[s.jsx(r,{children:a("crm.calls.id")}),s.jsx(r,{children:a("crm.calls.date")}),s.jsx(r,{children:a("crm.calls.duration")}),s.jsx(r,{children:a("crm.calls.status")}),s.jsx(r,{children:a("crm.calls.agent")}),s.jsx(r,{children:a("crm.calls.actions")})]})}),s.jsx(H,{children:h.map(e=>s.jsxs(x,{children:[s.jsxs(c,{className:"font-mono text-xs",children:[e.call_id.slice(0,8),"..."]}),s.jsx(c,{children:new Date(e.start_timestamp).toLocaleString()}),s.jsx(c,{children:C(e.duration_ms||0)}),s.jsx(c,{children:s.jsx(L,{variant:v(e.call_status),children:e.call_status})}),s.jsxs(c,{className:"font-mono text-xs",children:[e.agent_id.slice(0,8),"..."]}),s.jsx(c,{children:s.jsx(u,{size:"sm",variant:"outline",onClick:()=>l(`/crm/calls/${e.call_id}`),children:a("crm.calls.viewDetail")})})]},e.call_id))})]})})]})]})]})}export{I 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.