PageSourceSearch

https://fixie.digital/assets/WaIA-STb6TcWE.js

js fixie.digital collected 2026-10-04 14:34:00 UTC 3,670 bytes, 1 lines download raw bytes

1import{s as w,j as e}from"./index-M5i7n0tf.js";import{b as i}from"./vendor-react-CMHnv8wr.js";import{P as N,a as y,T as _,L as A}from"./ui-BNCFXxJJ.js";import{W as S}from"./WaTrazabilidad-CpSWb2P-.js";import"./vendor-supabase-B9q_TACa.js";import"./whatsapp-DQy3a4Cj.js";import"./Pager-ck1w3Veb.js";import"./waAvatars-B4E4rU-i.js";import"./feedbackClientes-DPrazYSy.js";const k=[{key:"asistidas",label:"Respuestas asistidas"},{key:"conversaciones",label:"Conversaciones de clientes"}];function C(s){return s?new Date(s).toLocaleString("es-MX",{day:"numeric",month:"short",hour:"2-digit",minute:"2-digit"}):"—"}function r({label:s,value:l,accent:c}){return e.jsxs("div",{className:"g-card p-4",children:[e.jsx("p",{className:"text-xs text-white/40 mb-1",children:s}),e.jsx("p",{className:`text-2xl font-bold ${c??"text-white"}`,children:l})]})}function B(){const[s,l]=i.useState("asistidas"),[c,h]=i.useState(!1),[n,p]=i.useState(null),[v,b]=i.useState(!0),[x,m]=i.useState(!1),[u,f]=i.useState(""),o=i.useCallback(async()=>{const{data:a,error:d}=await w.rpc("get_wa_ia_metrics");if(d){f(d.message);return}p(a)},[]);i.useEffect(()=>{o().finally(()=>b(!1))},[o]);async function j(){m(!0);try{await o()}finally{m(!1)}}function g(a){a==="conversaciones"&&h(!0),l(a)}const t=n==null?void 0:n.kpis;return e.jsxs(N,{children:[e.jsx(y,{title:"WhatsApp IA",subtitle:s==="asistidas"?"Respuestas asistidas con IA · borradores y envíos":void 0,actions:s==="asistidas"?e.jsx("button",{onClick:j,disabled:x,className:"px-3 py-1.5 rounded-lg text-sm text-white/60 hover:text-white bg-white/5 hover:bg-white/10 border border-white/10 transition-all disabled:opacity-40",children:x?"Actualizando…":"Actualizar"}):void 0}),e.jsx("div",{className:"max-w-full overflow-x-auto",children:e.jsx(_,{tabs:k,value:s,onChange:g})}),s==="asistidas"&&(v?e.jsx(A,{className:"h-64"}):e.jsxs(e.Fragment,{children:[u&&e.jsxs("div",{className:"g-card p-4 text-red-400 text-sm",children:["Error: ",u]}),t&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3",children:[e.jsx(r,{label:"Chats con IA activa",value:t.chats_ai_enabled,accent:"text-cyan"}),e.jsx(r,{label:"Borradores pendientes",value:t.borradores_pendientes}),e.jsx(r,{label:"Enviados (7d)",value:t.enviados_7d,accent:"text-emerald-400"}),e.jsx(r,{label:"Descartados (7d)",value:t.descartados_7d,accent:t.descartados_7d>0?"text-amber-400":"text-white"}),e.jsx(r,{label:"Cuentas en auto",value:t.cuentas_auto,accent:"text-violet-400"}),e.jsx(r,{label:"Agentes con la feature",value:t.agentes_feat})]}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-white font-semibold mb-3",children:"Actividad por agente"}),e.jsx("div",{className:"g-card divide-y divide-white/5 overflow-hidden",children:n.por_agente.length===0?e.jsx("div",{className:"px-4 py-8 text-center text-white/40 text-sm",children:"Sin actividad de respuestas asistidas todavía."}):n.por_agente.map((a,d)=>e.jsxs("div",{className:"flex items-center justify-between px-4 py-3 text-sm gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-white font-medium truncate",children:a.agente}),e.jsx("p",{className:"text-white/35 text-xs truncate",children:a.email})]}),e.jsxs("div",{className:"flex items-center gap-4 flex-shrink-0 text-xs",children:[e.jsxs("span",{className:"text-white/50",children:[a.borradores," borradores"]}),e.jsxs("span",{className:"text-emerald-400",children:[a.enviados," enviados"]}),e.jsx("span",{className:"text-white/30 hidden sm:inline",children:C(a.ultimo)})]})]},d))})]})]})]})),c&&e.jsx("div",{hidden:s!=="conversaciones",children:e.jsx(S,{})})]})}export{B 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.