From fa6b0a241d236a504029cc2af8b758212a04adc2 Mon Sep 17 00:00:00 2001 From: Benjamin Admin Date: Wed, 22 Apr 2026 00:00:54 +0200 Subject: [PATCH] fix: move chartDetail useState to component top level (hooks rule) --- pitch-deck/components/slides/FinanzplanSlide.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pitch-deck/components/slides/FinanzplanSlide.tsx b/pitch-deck/components/slides/FinanzplanSlide.tsx index 85c0009..85a44e0 100644 --- a/pitch-deck/components/slides/FinanzplanSlide.tsx +++ b/pitch-deck/components/slides/FinanzplanSlide.tsx @@ -102,6 +102,7 @@ export default function FinanzplanSlide({ lang, investorId, preferredScenarioId, const [rows, setRows] = useState([]) const [loading, setLoading] = useState(false) const [yearOffset, setYearOffset] = useState(0) // 0=2026, 1=2027, ... + const [chartDetail, setChartDetail] = useState(null) const de = lang === 'de' // KPIs loaded directly from fp_* tables (source of truth) @@ -317,7 +318,6 @@ export default function FinanzplanSlide({ lang, investorId, preferredScenarioId, const fmtK = (v: number) => Math.abs(v) >= 1000000 ? `${(v/1000000).toFixed(1)}M` : `${Math.round(v/1000)}k` const fmtV = (v: number) => v.toLocaleString('de-DE') - // Chart detail modal const chartDetails: Record = { mrr: { title: 'MRR (Monthly Recurring Revenue)', desc: de ? 'Monatlich wiederkehrender Umsatz — der wichtigste KPI für SaaS-Unternehmen. Zeigt die planbaren monatlichen Einnahmen aus laufenden Kundenverträgen. Wachsender MRR = wachsendes Geschäft.' : 'Monthly recurring revenue — the most important KPI for SaaS companies. Shows predictable monthly income from active customer contracts. Growing MRR = growing business.' }, ebit: { title: 'EBIT (Earnings Before Interest & Taxes)', desc: de ? 'Operatives Ergebnis vor Zinsen und Steuern — zeigt die tatsächliche Profitabilität des Geschäftsbetriebs. Positiver EBIT = das Geschäftsmodell funktioniert.' : 'Operating profit before interest and taxes — shows actual profitability of operations. Positive EBIT = the business model works.' }, @@ -329,7 +329,6 @@ export default function FinanzplanSlide({ lang, investorId, preferredScenarioId, nrr: { title: 'NRR (Net Revenue Retention)', desc: de ? 'Umsatzwachstum durch Bestandskunden — zeigt ob bestehende Kunden mehr ausgeben als sie kündigen. NRR > 100% bedeutet: das Geschäft wächst auch ohne Neukunden.' : 'Revenue growth from existing customers — shows if current customers spend more than they churn. NRR > 100% means: the business grows even without new customers.' }, ebitMargin: { title: 'EBIT Margin', desc: de ? 'Operatives Ergebnis in Prozent vom Umsatz. Zeigt die Effizienz des Geschäftsmodells. Ziel für SaaS: 20-30% in der Reifephase.' : 'Operating result as percentage of revenue. Shows business model efficiency. Target for SaaS: 20-30% at maturity.' }, } - const [chartDetail, setChartDetail] = useState(null) const detailInfo = chartDetail ? chartDetails[chartDetail] : null return (