--- import { getFooter } from '../data/home'; const path = Astro.url.pathname; const localeMatch = path.match(/^\/(en|th)(\/|$)/); const currentLocale = (localeMatch?.[1] ?? 'it') as 'it' | 'en' | 'th'; const footer = getFooter(currentLocale); const hasNewsletterAction = typeof footer.newsletter.actionUrl === 'string' && footer.newsletter.actionUrl.length > 0; const nl = footer.newsletter; const nextUrl = typeof nl.successRedirect === 'string' && nl.successRedirect.length > 0 ? nl.successRedirect : ''; const notifySubject = typeof nl.notifySubject === 'string' && nl.notifySubject.length > 0 ? nl.notifySubject : ''; const linkClass = 'text-sm text-sky-400/90 transition-colors hover:text-sky-300'; const withLocale = (href: string) => { if (currentLocale === 'it') return href; if (href.startsWith(`/${currentLocale}`)) return href; if (href.startsWith('/#')) return `/${currentLocale}${href}`; if (href.startsWith('/')) return `/${currentLocale}${href}`; return href; }; ---