PageSourceSearch

https://www.smallbizagent.ai/assets/FlaggedCalls-CJAj5uh8.js

js smallbizagent.ai collected 2026-10-05 15:06:39 UTC 4,528 bytes, 1 lines download raw bytes

1import{u as v,j as e,e as b,r as w,d as C}from"./vendor-query-CnAhr2B8.js";import{p as u,s as x,q,r as k,ae as g,d as n,n as f,a as F,H as L,ab as I,bd as Q,B as T,ak as K}from"./index-CLUtDhnY.js";import{C as M}from"./index-BIQLemby.js";import"./vendor-ui-CYA7SV0W.js";import"./vendor-charts-CPMWc2oJ.js";import"./vendor-forms-UY-il7MQ.js";import"./api-c_Wfq480.js";import"./textarea-VdIEZsUv.js";import"./switch-wa839A7l.js";import"./calendar-VsbRkqvx.js";import"./popover-En2VDOLx.js";import"./user-D7D5Y3_w.js";import"./play-rh91jfbb.js";import"./brain-C4pXsSiY.js";import"./pencil-XqPqJhqP.js";import"./trash-2-B9b4XGw8.js";import"./accordion-DFlr1gaC.js";import"./shield-alert-CwUUYaq9.js";import"./feature-tip-D5lKzg4O.js";import"./lightbulb-CC4qJ2Zf.js";import"./phone-forwarded-Du9grn4B.js";import"./info-CEGee0l4.js";function p(s){return s.replace(/_/g," ").replace(/\b\w/g,a=>a.toUpperCase())}function R({score:s}){var m;const a=b(),{toast:t}=F(),[i,d]=w.useState(!1),l=C({mutationFn:async()=>(await L("POST",`/api/call-quality/${s.callLogId}/dismiss-flag`)).json(),onMutate:()=>d(!0),onSuccess:()=>{a.invalidateQueries({queryKey:["/api/call-quality/business/flagged"]}),a.invalidateQueries({queryKey:["/api/call-quality/business/summary"]}),a.invalidateQueries({queryKey:[`/api/call-quality/${s.callLogId}`]}),t({title:"Marked as reviewed",description:"Removed from your flagged queue."})},onError:()=>{t({title:"Failed to dismiss",variant:"destructive"}),d(!1)}}),c=(m=s.failureModes)==null?void 0:m[0];return e.jsx("div",{className:"border rounded-lg p-3 hover:bg-muted/30 transition-colors",children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"flex-1 min-w-0 space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsxs(n,{variant:"outline",className:"bg-red-500/15 text-red-700 dark:text-red-400 border-red-500/30 text-xs font-semibold",children:[e.jsx(g,{className:"h-3 w-3 mr-1"}),s.totalScore.toFixed(1)," / 10"]}),c&&e.jsx(n,{variant:"outline",className:"text-xs",children:p(c)}),s.industry&&e.jsx("span",{className:"text-xs text-muted-foreground",children:s.industry})]}),e.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[e.jsx(I,{className:"h-3 w-3"}),e.jsx("span",{children:Q(s.scoredAt)}),e.jsx("span",{children:"·"}),e.jsxs("span",{children:["Call #",s.callLogId]})]}),(()=>{const r=Object.entries(s.dimensions);if(r.length===0)return null;const j=r.sort(([,y],[,N])=>y.score-N.score)[0],[h,o]=j;return o.justification?e.jsxs("p",{className:"text-xs text-muted-foreground line-clamp-2 pt-1",children:[e.jsxs("span",{className:"font-medium",children:[p(h),":"]})," ",o.justification]}):null})()]}),e.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[e.jsx(M,{callLogId:s.callLogId}),e.jsx(T,{variant:"outline",size:"sm",onClick:()=>l.mutate(),disabled:i||l.isPending,"data-testid":`dismiss-flag-${s.callLogId}`,children:l.isPending?e.jsx(K,{className:"h-3 w-3 animate-spin"}):e.jsxs(e.Fragment,{children:[e.jsx(f,{className:"h-3 w-3 mr-1"}),"Reviewed"]})})]})]})})}function te(){const{data:s,isLoading:a}=v({queryKey:["/api/call-quality/business/flagged"],staleTime:6e4});if(a)return e.jsx(u,{children:e.jsx(x,{className:"p-6",children:e.jsxs("div",{className:"animate-pulse space-y-3",children:[e.jsx("div",{className:"h-12 bg-muted rounded"}),e.jsx("div",{className:"h-12 bg-muted rounded"})]})})});const t=(s==null?void 0:s.flagged)||[];return e.jsxs(u,{children:[e.jsx(q,{className:"pb-3",children:e.jsx("div",{className:"flex items-center justify-between",children:e.jsxs(k,{className:"text-base font-medium flex items-center gap-2",children:[e.jsx(g,{className:"h-5 w-5 text-amber-500"}),"Flagged Calls",t.length>0&&e.jsx(n,{variant:"outline",className:"ml-1",children:t.length})]})})}),e.jsx(x,{children:t.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[e.jsx("div",{className:"rounded-full bg-green-500/10 p-3 mb-3",children:e.jsx(f,{className:"h-6 w-6 text-green-600 dark:text-green-400"})}),e.jsx("p",{className:"font-medium text-sm",children:"No flagged calls"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:"Your AI is doing great. Calls scoring under 6/10 (or with critical failures) will appear here for review."})]}):e.jsx("div",{className:"space-y-2",children:t.map(i=>e.jsx(R,{score:i},i.id))})})]})}export{te as FlaggedCalls,te 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.