// screens-electricity.jsx — Pagamento de Eletricidade (EAGB, contador pré-pago) via TeleTaku
const SAVED_METERS = [
{ label: "Casa", meter: "04123456789" },
{ label: "Loja Bandim", meter: "04987654321" },
];
const ELEC_AMOUNTS = [1000, 2500, 5000, 10000];
function fmtMeter(m) { const d = m.replace(/\D/g, ""); return d.replace(/^(\d{4})(\d{0,4})(\d{0,3}).*/, (_, a, b, c) => [a, b, c].filter(Boolean).join(" ")); }
function ScreenElectricity({ go, isDesktop }) {
const [step, setStep] = useState("form"); // form | success
const [meter, setMeter] = useState("");
const [amount, setAmount] = useState(2500);
const [sheet, setSheet] = useState(false);
const [copied, setCopied] = useState(false);
const digits = meter.replace(/\D/g, "");
const meterOk = digits.length === 11;
const saved = SAVED_METERS.find(m => m.meter === digits);
const token = "4821 0937 5512 8846 3307";
if (step === "success") {
return (
<>
go("services")} />
Pagamento concluído
Introduz este código no teu contador para carregar a energia. Enviámos também por SMS.
Código de recarga (token)
{token}
Contador{fmtMeter(digits)}
Valor{fmtXof(amount)} XOF
Pago comTeleTaku
ReferênciaEAGB-55102938
>
);
}
return (
<>
go("services")} />
Energia pré-paga EAGB
Compra crédito de energia e recebe o código na hora.
Contadores guardados
{SAVED_METERS.map(m => (
setMeter(m.meter)}> {m.label}
))}
Valor
{ELEC_AMOUNTS.map(a => (
))}
Pagar com
{}} price={amount} onlyTeletaku />
Últimos pagamentos
{[{ d: "28 Set 2026", v: 5000, m: "Casa" }, { d: "12 Set 2026", v: 2500, m: "Loja Bandim" }].map((r, i) => (
))}
{sheet ? setSheet(false)} onDone={() => { setSheet(false); setStep("success"); }} /> : null}
>
);
}
Object.assign(window, { ScreenElectricity });