50 lines
1.7 KiB
JavaScript
50 lines
1.7 KiB
JavaScript
|
|
import { DYN, ACT_COLOR, money2 } from "../../lib/constants";
|
||
|
|
import { cierreVencido } from "../../lib/derive";
|
||
|
|
|
||
|
|
// Tabla del informe individual — puerto de repRow()/repTable() (App Informe/assets/js/modals.js).
|
||
|
|
export default function RepTable({ arr }) {
|
||
|
|
if (!arr.length) return <p className="hint">Ninguna oportunidad en esta categoría — bien ahí.</p>;
|
||
|
|
const sorted = [...arr].sort((a, b) => b.est - a.est);
|
||
|
|
return (
|
||
|
|
<div className="tw">
|
||
|
|
<div className="ts" style={{ maxHeight: "none" }}>
|
||
|
|
<table>
|
||
|
|
<thead>
|
||
|
|
<tr>
|
||
|
|
<th>Cliente</th>
|
||
|
|
<th>Oportunidad</th>
|
||
|
|
<th>Plan cierre</th>
|
||
|
|
<th>Fase actual</th>
|
||
|
|
<th>Actividad</th>
|
||
|
|
<th className="num">MRR est.</th>
|
||
|
|
<th>Cierre est.</th>
|
||
|
|
</tr>
|
||
|
|
</thead>
|
||
|
|
<tbody>
|
||
|
|
{sorted.map((o) => (
|
||
|
|
<tr key={o.id}>
|
||
|
|
<td>{o.cliente || "—"}</td>
|
||
|
|
<td>
|
||
|
|
<a className="opp" href={`${DYN}${o.id}`} target="_blank" rel="noopener">
|
||
|
|
{o.name}
|
||
|
|
</a>
|
||
|
|
</td>
|
||
|
|
<td>{(o.plan || "").replace(" - ", " ")}</td>
|
||
|
|
<td>{o.faseActual || "—"}</td>
|
||
|
|
<td>
|
||
|
|
<span style={{ color: ACT_COLOR[o.actividad] || "#9db4c9", fontWeight: 700 }}>● {o.actividad}</span>
|
||
|
|
</td>
|
||
|
|
<td className="num">{money2(o.est)}</td>
|
||
|
|
<td>
|
||
|
|
{o.close || "—"}
|
||
|
|
{cierreVencido(o) ? " ⚠" : ""}
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
))}
|
||
|
|
</tbody>
|
||
|
|
</table>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
);
|
||
|
|
}
|