/* global React, OnboardingHeader, PrimaryButton */ // Yomee — Extraction Review (Confidence Gate) // /onboarding/review // // Inserted between Upload and Radiografía when the user has uploaded // exactly 3 files (the full UPLOAD_SEQUENCE). The screen shows a single // low-confidence (65%) extraction card for the THIRD uploaded file and // asks the user to confirm 3 hardcoded fields before continuing. // // Design notes: // • Tokens come from colors_and_type.css. The original brief was // written in Tailwind shorthand (bg-primary, font-heading, etc.) — // we translate to the existing var(--yo-*) tokens so this screen // matches the rest of the app rather than introducing a new system. // • Mascot uses pocopin-3.png (the existing mascot in this repo). // • CTA uses PrimaryButton variant="primary" — the disabled state is // the system's standard 22%-ink fill, not a gradient. // // Analytics: track() calls are stubbed (window.track || no-op) and fire // on mount + on the CONTINUAR tap. const { useState: useStateER, useEffect: useEffectER } = React; // Hardcoded extraction values — prototype only. Per the brief these are // matched to the third uploaded file (Nu) regardless of which actual // file ended up in slot [2] of the UPLOAD_SEQUENCE. const REVIEW_FILE = { name: "Nu_Morada_Feb2026.pdf", bank: "Nu", }; const REVIEW_FIELDS = [ { key: "deuda", label: "Deuda total detectada", value: "$22,146" }, { key: "intereses", label: "Intereses y comisiones detectados", value: "$7,887" }, { key: "minimo", label: "Pago mínimo detectado", value: "$1,987" }, ]; const _track = (...args) => { if (typeof window !== "undefined" && typeof window.track === "function") { window.track(...args); } }; // ──────────────────────────────────────────────── // SuccessCheckSmall — green circle + white checkmark for the inline // Pocopin tip card. Smaller than the file-row check in UploadScreen. // ──────────────────────────────────────────────── function ReviewSuccessCheck() { return (
); } // ──────────────────────────────────────────────── // Confidence badge — amber pill with dot + "Confianza 65%" // ──────────────────────────────────────────────── function ConfidenceBadge({ pct = 65 }) { return (
); } // ──────────────────────────────────────────────── // Circular checkbox — primary-bordered circle that fills with mint and // a white check on toggle. Matches the brief's "circular checkbox" // pattern; uses the app's mint accent so it sits in the existing palette // instead of introducing a new "primary" color. // ──────────────────────────────────────────────── function CircleCheckbox({ checked, onToggle, label }) { return ( ); } // ──────────────────────────────────────────────── // Read-only / lightly editable field. Uses the app's input shape // (16px radius, ink border-soft, mono text). // ──────────────────────────────────────────────── function ReviewField({ label, value, onChange }) { return ( ); } // ──────────────────────────────────────────────── // Main screen // ──────────────────────────────────────────────── function ExtractionReviewScreen({ onBack, onContinue }) { const [confirmed, setConfirmed] = useStateER(false); const [processing, setProcessing] = useStateER(false); // Editable copies of the extracted values — the user can correct any // field, but no validation is enforced (prototype rule). const [fields, setFields] = useStateER(() => REVIEW_FIELDS.reduce((acc, f) => ({ ...acc, [f.key]: f.value }), {}), ); // Fire confidence_gate_triggered on mount. useEffectER(() => { _track("confidence_gate_triggered", { numLowConfidenceFiles: 1, screen: "/onboarding/review", }); }, []); const handleContinue = () => { if (!confirmed || processing) return; _track("extraction_review_completed", { screen: "/onboarding/review" }); setProcessing(true); setTimeout(() => { onContinue && onContinue(); }, 1500); }; return (
{/* Scrollable content */}
{/* Title */}

Un paso más para tu diagnóstico exacto

{/* Subtitle */}

Algunos datos necesitan tu confirmación.{" "} Entre más precisos, mejor tu radiografía.

{/* Pocopin tip card */}
Tu archivo se procesó. Solo verifica que los{" "} 3 números clave{" "} sean correctos — no tienes que revisarlo todo.
{/* Confidence card */}
{/* Header row */}
{REVIEW_FILE.name}
{REVIEW_FILE.bank}
{/* Editable fields */}
{REVIEW_FIELDS.map((f) => ( setFields((prev) => ({ ...prev, [f.key]: v })) } /> ))}
{/* Divider */}
{/* Confirmation row */} setConfirmed((v) => !v)} label="Confirmo que estos datos son correctos" />
{/* Fixed footer CTA */}
{processing ? "GENERANDO TU RADIOGRAFÍA…" : "CONTINUAR"}
{/* Processing overlay — Pocopin + spinner + label */} {processing && (
Generando tu radiografía…
)}
); } window.ExtractionReviewScreen = ExtractionReviewScreen;