import type { AssembledProposal } from "@/lib/proposal/assemble"; type Props = { tiers: AssembledProposal["offer"]["tiers"] }; function formatEur(val: string | null | undefined): string { if (!val) return "—"; const n = parseFloat(val); return `€${n.toLocaleString("it-IT")}`; } export function PricingSection({ tiers }: Props) { return (

Le tre opzioni

Tre tappe, un solo risultato.

{tiers.map((tier, i) => { const isHighlighted = i === 1; // tier B highlighted di default const price = tier.publicPrice ?? tier.servicesTotal; const durationLabel = `${tier.durationMonths} ${tier.durationMonths === 1 ? "mese" : "mesi"}`; return (

Opzione {tier.tierLetter} / {durationLabel}

{tier.publicName}

{tier.tierLetter}

{formatEur(price)}

{tier.durationMonths > 1 ? `${tier.durationMonths} mesi` : "pagamento unico"}

{/* Servizi inclusi */} {tier.services.length > 0 && (
    {tier.services.map((s) => (
  • {s.name}
  • ))}
)}
); })}

Le tre opzioni si compongono progressivamente. La C eredita tutto da B, che a sua volta eredita tutto da A.

); }