import { formatPrice } from "../lib/format"; import type { TaxBreakdownGroup } from "../lib/taxBreakdown"; // The actual amount of VAT included in a total — not just a disclosure // that VAT is included (see cartTotals.ts's effectiveTaxRate() for the // "which %" shown next to each line item elsewhere). One line per rate // when a cart/order spans more than one; a single line otherwise. export function VatBreakdown({ groups }: { groups: TaxBreakdownGroup[] }) { if (groups.length === 0) return null; if (groups.length === 1) { const [g] = groups; return (

enthält {g.rate}% MwSt.: {formatPrice(g.tax)}

); } return (

enthält MwSt.:

{groups.map((g) => (

{g.rate}%: {formatPrice(g.tax)}

))}
); }