import type { ReactNode } from "react"; import type { ForecastMonth } from "@/lib/forecast-queries"; export function ForecastChart({ data, headerAction, }: { data: ForecastMonth[]; headerAction?: ReactNode; }) { const max = Math.max(...data.map((d) => d.total), 1); // index 1 = mese prossimo (evidenziato) return (

Previsione Flussi di Cassa (12 Mesi)

Stima basata su retainer attivi e saldi dilazionati

{headerAction}
{data.map((m, i) => { const pct = Math.round((m.total / max) * 100); const isNext = i === 1; return (
0 ? "4px" : "0" }} title={`${m.label}: ${m.total.toLocaleString("it-IT", { style: "currency", currency: "EUR", minimumFractionDigits: 2 })}`} />
{m.label.split(" ")[0]}
); })}
); }