"use client"; import { Card } from "@/components/ui/card"; import { OfferMicro, OfferPhase } from "@/db/schema"; interface QuotePreviewProps { offer: (OfferMicro & { phases: OfferPhase[] }) | null; selectedTotal: number; } export function QuotePreview({ offer, selectedTotal }: QuotePreviewProps) { if (!offer) { return (

Seleziona un'offerta per visualizzare l'anteprima

); } return (

{offer.public_name}

{offer.transformation_promise && (

{offer.transformation_promise}

)}

Durata: {offer.duration_months} mese{offer.duration_months !== 1 ? "i" : ""}

Fasi incluse

{offer.phases && offer.phases.length > 0 ? ( offer.phases.map((phase) => (

{phase.title}

{phase.description && (

{phase.description}

)}
)) ) : (

Nessuna fase configurata

)}
Totale preventivo €{selectedTotal.toLocaleString("it-IT", { minimumFractionDigits: 2, maximumFractionDigits: 2 })}

Questo preventivo sarà visibile al cliente tramite link riservato

); }