import { AlertTriangle, Receipt } from 'lucide-react'; import { formatMoney } from './format'; import { INVOICES_SECTIONS } from './shared'; import { useInvoicesSection } from './useInvoicesSection'; import { useSummary } from './useInvoiceShelfData'; // Panel header for the right (invoices-view) panel: which section, which company, and the one figure that // is worth seeing from every section — how much is still owed. export const InvoicesViewHeader = () => { const section = useInvoicesSection(); const { company, currency, dashboard, error } = useSummary(); const label = INVOICES_SECTIONS.find((s) => s.id === section)?.label ?? 'Invoices'; return ( <> {label} {company?.name && · {company.name}} {error ? ( unreachable ) : ( dashboard && ( {formatMoney(dashboard.total_amount_due, currency)} due ) )} ); };