"use client"; import { useFormContext } from "@/components/offerte/form-context"; import { Button } from "@/components/ui/button"; import { Send, Check } from "lucide-react"; const fieldLabels: Record = { productType: "Product", height: "Hoogte", width: "Breedte", glassType: "Glas Type", finish: "Afwerking", name: "Naam", email: "E-mail", phone: "Telefoon", note: "Opmerking", }; const fieldOrder = [ "productType", "height", "width", "glassType", "finish", "name", "email", "phone", "note", ]; function formatValue(key: string, value: unknown): string { if (value === undefined || value === null || value === "") return "—"; if (key === "height" || key === "width") return `${value} mm`; return String(value); } export function StepSummary() { const { formData } = useFormContext(); return (

Overzicht

Controleer uw configuratie en verstuur de aanvraag.

{fieldOrder.map((key, i) => { const value = formData[key as keyof typeof formData]; return ( ); })}
{fieldLabels[key]} {value !== undefined && value !== "" && ( )} {formatValue(key, value)}
); }