import { getTranslations } from 'next-intl/server';
import { Container } from '@/components/ui/container';
import { Reveal } from '@/components/ui/reveal';
import { QuoteForm } from '@/components/forms/quote-form';
import { buildMetadata } from '@/lib/seo';
import type { Locale } from '@/i18n/config';

export async function generateMetadata({ params: { locale } }: { params: { locale: Locale } }) {
  const t = await getTranslations({ locale, namespace: 'quoteForm' });
  return buildMetadata({ locale, path: '/devis', title: t('title'), description: t('subtitle') });
}

export default async function DevisPage({ params: { locale } }: { params: { locale: Locale } }) {
  const t = await getTranslations({ locale, namespace: 'quoteForm' });

  return (
    <Container className="py-16">
      <Reveal variant="up">
        <h1 className="font-display text-3xl font-semibold">{t('title')}</h1>
      </Reveal>
      <Reveal variant="up" delay={90}>
        <p className="mt-2 max-w-xl text-graphite-900/60">{t('subtitle')}</p>
      </Reveal>
      <div className="mt-10">
        <QuoteForm locale={locale} />
      </div>
    </Container>
  );
}
