/* global React, ChIcon, NavIcon, CHANNELS */ const { useState: useStateP, useMemo: useMemoP } = React; // ============ Data ============ const PENDING_ACTION = [ { id: "CNL-2840", channel: "call", customer: "Roberto Cifuentes", company: "Constructora Cifuentes Hnos.", printer: "Canon imageRUNNER 2630i", serial: "DLP04221 (no encontrada)", blocker: "Escalado por SOF.IA · cliente en línea esperando", why: "serie no aparece · compra al contado", waitFor: "00:01:08", slaPct: 12, primary: "Tomar línea", secondary: "Devolver a SOF.IA", severity: "danger", route: "escalation", }, { id: "CNL-2837", channel: "call", customer: "Industrias Polar", company: "Industrias Polar de CA", printer: "Canon LBP6230dw", serial: "—", blocker: "Equipo arrendado robado · requiere trámite con seguro", why: "equipo retirado / robado", waitFor: "00:18:02", slaPct: 62, primary: "Tomar caso", secondary: "Asignar", severity: "warn", route: "escalation", }, { id: "CNL-2834", channel: "call", customer: "Helena Castañeda", company: "Clínicas Vida Nueva", printer: "HP LaserJet Pro M428", serial: "CNB8H4XXXX (ilegible)", blocker: "Cliente no pudo leer la serie completa · enviada a Taller", why: "cliente no puede dar serie", waitFor: "00:14:30", slaPct: 48, primary: "Revisar en Taller", secondary: "Reasignar", severity: "warn", }, ]; const PENDING_CUSTOMER = [ { id: "CNL-2839", channel: "web", customer: "Luis Pérez", company: "Imprenta Color GT", printer: "HP LaserJet M428fdw", serial: "CNB8H42P11", blocker: "Esperando que el cliente envíe la página de calidad", why: "indagación HW · pendiente input", waitFor: "00:08:14", slaPct: 24, primary: "Recordar al cliente", secondary: "Ver chat", severity: "ok", }, { id: "CNL-2738", channel: "whatsapp", customer: "Tienda La Aurora", company: "Tienda La Aurora, S.A.", printer: "HP LaserJet Pro M404n", serial: "VNB6L33042", blocker: "Cliente no confirma horario de visita propuesto", why: "esperando confirmación de agenda", waitFor: "02:14:08", slaPct: 41, primary: "Recordar al cliente", secondary: "Reagendar", severity: "warn", }, { id: "CNL-2701", channel: "email", customer: "Bufete Solórzano", company: "Solórzano & Asoc.", printer: "HP OfficeJet Pro 9015e", serial: "TH2C4471XL", blocker: "Cliente sin responder desde ayer · solicitamos NIT", why: "validación de cliente pendiente", waitFor: "1d 03:42", slaPct: 78, primary: "Reenviar correo", secondary: "Cerrar como no-respuesta", severity: "danger", }, ]; const PENDING_SLA = [ { id: "CNL-2701", channel: "email", customer: "Bufete Solórzano", company: "Solórzano & Asoc.", printer: "HP OfficeJet Pro 9015e", serial: "TH2C4471XL", blocker: "Sin primera respuesta del cliente · 78% del SLA consumido", why: "SLA primera respuesta · vence en 3:18", waitFor: "1d 03:42", slaPct: 78, primary: "Escalar", secondary: "Reenviar", severity: "danger", }, { id: "CNL-2611", channel: "whatsapp", customer: "Hotel del Lago", company: "Hotel del Lago Atitlán", printer: "HP Color LaserJet M283fdw", serial: "CNF8R55801", blocker: "Visita agendada se aproxima · falta confirmar arribo", why: "SLA visita · vence en 0:47", waitFor: "06:22:11", slaPct: 88, primary: "Confirmar arribo", secondary: "Reagendar", severity: "danger", }, ]; const PENDING_APPROVALS = [ { kind: "visit", title: "Visita técnica propuesta · Notaría Estrada (CNL-2836)", sub: "SOF.IA agendó visita para miércoles 28/05 entre 9:00 y 12:00 con Walter A. Galindo. Esperando tu aprobación final por estar dentro de la franja matutina premium.", meta: [ { k: "Cliente", v: "Notaría Estrada & Asoc." }, { k: "Equipo", v: "HP OfficeJet Pro 9015e · TH1B9011XK" }, { k: "Técnico", v: "Walter A. Galindo · zona 10" }, { k: "Propuesto", v: "hace 12 min" }, ], }, { kind: "rule", title: "Regla sugerida por SOF.IA · fallback por NIT", sub: "Detecté 41 casos en 30 días donde la serie no apareció y el operador resolvió buscando por NIT. ¿Quieres que lo haga automáticamente como segundo intento antes de escalar?", meta: [ { k: "Patrón", v: "32% de los escalamientos del mes" }, { k: "Impacto estimado", v: "−36 escalamientos/mes" }, { k: "Riesgo", v: "Bajo · sin cambio en datos cliente" }, ], }, { kind: "kb", title: "KB sugerida · Error 49.4C02 en HP M428fdw", sub: "7 casos resueltos manualmente con el mismo procedimiento en 14 días. SOF.IA preparó un borrador del artículo.", meta: [ { k: "Borrador", v: "5 pasos + 1 repuesto" }, { k: "Autor sugerido", v: "Eddy R. Marroquín" }, ], }, { kind: "scope", title: "Caso marcado ‘fuera de alcance fase 1’ · Cotización Importadora Sol", sub: "Cliente facturado solicitó cotización de mantenimiento. SOF.IA aplicó la regla R-004 y marcó el caso fuera de alcance. ¿Confirmas o lo retomas manualmente?", meta: [ { k: "Cliente", v: "Importadora Sol · Mario Ovalle" }, { k: "Regla aplicada", v: "R-004 · facturado/cotización" }, { k: "Recibido", v: "hace 28 min" }, ], }, ]; const APPR_ICON = { visit: , rule: , kb: , scope: , }; const FILTERS = [ { id: "all", label: "Todos" }, { id: "action", label: "Tu acción" }, { id: "customer", label: "Esperando cliente" }, { id: "sla", label: "SLA en riesgo" }, { id: "approval", label: "Aprobaciones" }, ]; // ============ Row ============ const PendRow = ({ t, openTicket }) => { const cls = t.severity === "danger" ? "danger" : t.severity === "warn" ? "warn" : ""; return (
openTicket(t)}>
#{t.id}
{t.customer} {t.company}
{t.printer} SN · {t.serial}
{t.blocker} {t.why}
{t.waitFor} {t.slaPct}% SLA
e.stopPropagation()}>
); }; // ============ Main ============ const PendingScreen = ({ openTicket, goToEscalation, setRoute }) => { const [filter, setFilter] = useStateP("all"); const counts = { action: PENDING_ACTION.length, customer: PENDING_CUSTOMER.length, sla: PENDING_SLA.length, approval: PENDING_APPROVALS.length, }; const total = counts.action + counts.customer + counts.sla + counts.approval; const handleOpen = (t) => { if (t.route === "escalation") { goToEscalation(); } else { openTicket(t); } }; const show = (key) => filter === "all" || filter === key; return (

Bandeja del operador · {total} tickets en espera

Pendientes

Tu acción {counts.action}
Esperando cliente {counts.customer}
SLA en riesgo {counts.sla}
Aprobaciones {counts.approval}
{/* Cross-nav */}
setRoute && setRoute("queue")}> Activos 22 Pendientes {total} setRoute && setRoute("resolved")}> Resueltos hoy 47 setRoute && setRoute("lifecycle")}> Todos los tickets 52
{/* Filter row */}
Categoría
{FILTERS.map(f => ( setFilter(f.id)} > {f.label} {f.id === "all" ? total : counts[f.id]} ))}
{/* Section: Requieren tu acción */} {show("action") && (
Requieren tu acción ahora {counts.action} · cliente esperando
{PENDING_ACTION.length === 0 ?
— sin pendientes —
: PENDING_ACTION.map(t => ) }
)} {/* Section: Esperando cliente */} {show("customer") && (
Esperando respuesta del cliente {counts.customer} · sin respuesta reciente
{PENDING_CUSTOMER.length === 0 ?
— sin pendientes —
: PENDING_CUSTOMER.map(t => ) }
)} {/* Section: SLA en riesgo */} {show("sla") && (
SLA en riesgo {counts.sla} · acción preventiva sugerida
{PENDING_SLA.length === 0 ?
— todos los SLA están sanos —
: PENDING_SLA.map(t => ) }
)} {/* Section: Aprobaciones */} {show("approval") && (
Aprobaciones pendientes {counts.approval} · SOF.IA preparó propuestas
{PENDING_APPROVALS.map((a, i) => (
{APPR_ICON[a.kind]}
{a.title}
{a.sub}
{a.meta.map((m, j) => ( {m.k}: {m.v} ))}
))}
)}
); }; window.PendingScreen = PendingScreen;