Files
Ronni Baslund 9c08973e46 refactor(portal): delete data/customers.ts fixture entirely
Replace the last two holdouts: the dashboard partner-identity fallback now uses the real useMe().partner name, and the decorative MRR sparkline (dashboard + reports) moves to a generated useMrrTrendline() — deterministic, clearly placeholder-only, until a daily MRR-snapshot job exists. Removes the dead sparkLast/sparkTrendPct vars. The data/customers.ts fixture module is now fully deleted; the partner portal carries no mock business data.
2026-05-30 14:57:17 +02:00

16 lines
773 B
TypeScript

// Decorative MRR trendline for the partner dashboard + reports sparklines.
//
// Historical MRR isn't stored yet (that needs a daily MRR-snapshot job, same
// future work as the operator metrics pipeline), so the sparkline shape is
// PURELY VISUAL — a deterministic ease-out ramp with a gentle wave so it reads
// as organic growth. It is not real data and must not be presented as such;
// when a real series lands, swap this for the snapshot query. Deterministic
// (no Math.random) so SSR and client renders match.
export function useMrrTrendline(points = 90): number[] {
return Array.from({ length: points }, (_, i) => {
const t = i / (points - 1)
const eased = 1 - (1 - t) ** 2
return Math.round(38000 + eased * 17000 + Math.sin(i / 7) * 320)
})
}