25 lines
1 KiB
JavaScript
25 lines
1 KiB
JavaScript
import { money } from "../../lib/constants";
|
|
|
|
// Tarjeta de KPI con el MRR estimado de cada segmento del plan (Cierre, Negociación, Presentar
|
|
// oferta, Seguimientos, Renovaciones) — el `subtotal` de cada sección. Compartida por Plan del Día
|
|
// y Plan de Actividades; va también en el PDF (está dentro de `.plan-kpis`).
|
|
export default function MrrSegmentos({ secciones, nota }) {
|
|
const total = secciones.reduce((t, s) => t + (s.subtotal || 0), 0);
|
|
return (
|
|
<div className="kpi mrr-seg">
|
|
<span className="l mrr-seg-t">MRR estimado por segmento{nota ? ` · ${nota}` : ""}</span>
|
|
<div className="mrr-seg-grid">
|
|
{secciones.map((s) => (
|
|
<div key={s.key} className={`mrr-seg-i sec-${s.key}`}>
|
|
<span className="n">{money(s.subtotal || 0)}</span>
|
|
<span className="l">{s.titulo}</span>
|
|
</div>
|
|
))}
|
|
<div className="mrr-seg-i mrr-seg-total">
|
|
<span className="n">{money(total)}</span>
|
|
<span className="l">Total</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|