--- import { getCta } from '../data/home'; const path = Astro.url.pathname; const localeMatch = path.match(/^\/(en|th)(\/|$)/); const currentLocale = (localeMatch?.[1] ?? 'it') as 'it' | 'en' | 'th'; const cta = getCta(currentLocale); const cf = cta.contactForm; const model = { actionUrl: cf.actionUrl, mailto: cf.mailto, turnstileSiteKey: cf.turnstileSiteKey, notifySubject: cf.notifySubject, successRedirect: cf.successRedirect, fieldName: cf.fieldName, fieldCompany: cf.fieldCompany, fieldCountry: cf.fieldCountry, fieldDepartment: cf.fieldDepartment, fieldEmail: cf.fieldEmail, fieldMessage: cf.fieldMessage, turnstileError: cf.errors.turnstile, configError: cf.errors.config, mailtoFallbackSubject: cf.mailtoFallbackSubject, mailtoLabelName: cf.mailtoLabels.name, mailtoLabelCompany: cf.mailtoLabels.company, mailtoLabelEmail: cf.mailtoLabels.email, mailtoLabelCountry: cf.mailtoLabels.country, mailtoLabelDepartment: cf.mailtoLabels.department, mailtoDefaultDepartment: cf.mailtoLabels.defaultDepartment, }; const hasFormspree = typeof cf.actionUrl === 'string' && cf.actionUrl.length > 0; const hasTurnstile = typeof cf.turnstileSiteKey === 'string' && cf.turnstileSiteKey.length > 0; const nextUrl = typeof cf.successRedirect === 'string' && cf.successRedirect.length > 0 ? cf.successRedirect : ''; const notifySubject = typeof cf.notifySubject === 'string' && cf.notifySubject.length > 0 ? cf.notifySubject : ''; const fieldClass = 'mt-1.5 min-h-10 w-full rounded-lg border border-nx-border bg-nx-bg/80 px-3 text-sm text-nx-fg outline-none ring-sky-500/30 focus:border-sky-500/40 focus:ring-2'; ---
{cf.description}