--- /** * ContactForm * Contactformulier met naam, e-mail, bericht. Client-side validatie. * Submit via action URL (Formspree, Netlify Forms, eigen endpoint). * * Props: * - headline?: string * - sub?: string * - action: string — form action URL * - method?: 'POST' | 'GET' * - successMessage?: string * - fields?: ('phone' | 'company' | 'subject')[] — extra optionele velden * - netlify?: boolean — Netlify Forms support */ interface Props { headline?: string; sub?: string; action: string; method?: 'POST' | 'GET'; successMessage?: string; fields?: ('phone' | 'company' | 'subject')[]; netlify?: boolean; } const { headline = 'Stuur een bericht', sub, action, method = 'POST', successMessage = 'Bedankt! We nemen zo snel mogelijk contact op.', fields = [], netlify = false, } = Astro.props; ---
{(headline || sub) && (
{headline &&

{headline}

} {sub &&

{sub}

}
)}
{netlify && }
{fields.includes('phone') && (
)} {fields.includes('company') && (
)} {fields.includes('subject') && (
)}