INNER CODE UNIT · JavaScript
cut
rootSunc/CNEquity · frontend/src/main.js:139
return cut === -1 ? line : line.slice(0, cut).trimEnd();
}
// --- overview ---------------------------------------------------------------
const kpi = (n, label, note = "", tone = "") =>
`<article class="metric-card${tone ? ` metric-card-${tone}` : ""}"><div class="metric-label">${label}</div>
<div class="metric-value">${n}</div>${note ? `<div class="metric-note">${note}</div>` : ""}</article>`;
/** One tone map for every status word the API hands the console.
*
* Batch statuses, dataset freshness and audit severities were being coloured
* by three separate inline ternaries that had already drifted: `failed` was
* orange as a pill and red as a chip, in the same table row. They are one
* vocabulary; keep one table. An unlisted word falls through to the neutral
* chip rather than guessing at it. */
const TONE = {
fresh: "fresh", success: "fresh", running: "running",