diff --git a/app/[locale]/contact/page.tsx b/app/[locale]/contact/page.tsx index c84008a8..859ec433 100644 --- a/app/[locale]/contact/page.tsx +++ b/app/[locale]/contact/page.tsx @@ -2,10 +2,9 @@ import ContactForm from '@/components/ContactForm'; import JsonLd from '@/components/JsonLd'; import { Container, Heading, Section } from '@/components/ui'; import { Metadata } from 'next'; -import { useTranslations } from 'next-intl'; import { getTranslations } from 'next-intl/server'; +import { Suspense } from 'react'; import dynamic from 'next/dynamic'; - const LeafletMap = dynamic(() => import('@/components/LeafletMap'), { ssr: false, loading: () => ( @@ -27,30 +26,48 @@ export async function generateMetadata({ params: { locale } }: ContactPageProps) title: t('title'), description: t('subtitle'), alternates: { - canonical: `/${locale}/contact`, + canonical: `https://klz-cables.com/${locale}/contact`, languages: { - 'de': '/de/contact', - 'en': '/en/contact', - 'x-default': '/en/contact', + 'de-DE': '/de/contact', + 'en-US': '/en/contact', }, }, openGraph: { title: `${t('title')} | KLZ Cables`, description: t('subtitle'), url: `https://klz-cables.com/${locale}/contact`, + siteName: 'KLZ Cables', + images: [ + { + url: 'https://klz-cables.com/logo.png', + width: 1200, + height: 630, + alt: 'KLZ Cables Contact', + }, + ], + locale: `${locale.toUpperCase()}_DE`, + type: 'website', }, twitter: { card: 'summary_large_image', title: `${t('title')} | KLZ Cables`, description: t('subtitle'), + images: ['https://klz-cables.com/logo.png'], + }, + robots: { + index: true, + follow: true, }, }; } -export default function ContactPage() { - const t = useTranslations('Contact'); - const locale = t('locale') || 'en'; // Fallback if needed, but usually passed via params +export async function generateStaticParams() { + return [{ locale: 'de' }, { locale: 'en' }]; +} +export default async function ContactPage({ params }: ContactPageProps) { + const { locale } = params; + const t = await getTranslations({ locale, namespace: 'Contact' }); return (