import { FaTriangleExclamation } from 'react-icons/fa6' import { Badge, Card, EmptyState } from '../ui' import { forecastNotes, forecastRows } from '../../lib/financeView' /** * Block 3: „Vorschau 30 Tage“. Je Posten Datum, Bezeichnung, „sicher“/„erwartet“ (als Text), Betrag mit Vorzeichen * und der laufende Saldo beider Linien ab dem Kontostand. Ohne Kontostand entfallen die Saldo-Spalten (mit Hinweis). * Darunter die Annahme des Servers und Hinweise, wenn Stripe oder die Abos fehlen. Schmal (Karte bis 560 px) * wird jede Zeile dreizeilig: Datum, Sicherheit und Betrag / Posten / beide Salden; ohne Salden sind es zwei Zeilen. */ export default function ForecastTable({ vorschau, kontostandCents, stripeDown = false, abosFehler = false }) { const v = vorschau && typeof vorschau === 'object' ? vorschau : {} const { rows, hasBalance } = forecastRows(v.posten, kontostandCents) const notes = forecastNotes({ kontostandCents, stripeDown, abosFehler, hasRows: rows.length > 0 }) const assumption = typeof v.annahme === 'string' ? v.annahme.trim() : '' return ( {rows.length === 0 ? ( ) : (
{hasBalance && ( <> )} {rows.map((row) => ( {hasBalance && ( <> )} ))}
Erwartete Zahlungen der nächsten 30 Tage
Datum Posten Sicherheit BetragSaldo sicher Saldo erwartet
{row.dateText} {row.label} {row.sicherheit} {row.amountText} {row.saldoSicherText} {row.saldoErwartetText}
)} {(notes.length > 0 || assumption) && (
{notes.map((note) => (

))} {assumption &&

{assumption}

}
)}
) }