// Cadastros — Clientes / Vendedores (telas simples para mostrar o crescimento do sistema) function ClientesPage({ vendas }) { const clientes = window.MP_DATA.clientes; const [busca, setBusca] = React.useState(""); const lista = clientes.filter(c => !busca || c.nome.toLowerCase().includes(busca.toLowerCase())); return ( <>
Cadastros

Clientes

{clientes.length} clientes cadastrados.

setBusca(e.target.value)} placeholder="Buscar cliente..." style={{ marginLeft: 8 }} />
{lista.map(c => { const ops = vendas.filter(v => v.clienteId === c.id); const total = ops.reduce((s, v) => s + v.valor, 0); return ( ); })}
Cliente CNPJ Contato Cidade OPs Total vendido
{c.nome}{c.endereco}
{c.cnpj}
{c.contato}{c.telefone}
{c.cidade}/{c.uf} {ops.length} {fmtBRL(total)}
); } function VendedoresPage({ vendas }) { const vs = window.MP_DATA.vendedores; return ( <>
Cadastros

Vendedores

{vs.length} vendedores ativos no time comercial.

{vs.map(v => { const ops = vendas.filter(x => x.vendedorId === v.id); const total = ops.reduce((s, x) => s + x.valor, 0); const peso = ops.reduce((s, x) => s + x.peso, 0); return (
{v.iniciais}
{v.nome}
{v.email}
OPs
{ops.length}
Peso
{fmtNumber(peso)} kg
Total
{fmtBRL(total)}
); })}
); } function SoonPage({ title, hint }) { return ( <>
Em breve

{title}

); } window.ClientesPage = ClientesPage; window.VendedoresPage = VendedoresPage; window.SoonPage = SoonPage;