import images from '@/assets/images/images';
import InnerPageBanner from '@/components/layout/innerPages/banner';
import AboutDescription from '@/components/pages/about/AboutDescription';
import AboutTopInfo from '@/components/pages/about/TopInfo';
import HomeStorySection from '@/components/pages/home/HomeStorySection';
import { IPageParams } from '@/models/layout';
import { setRequestLocale } from 'next-intl/server';
import { getTranslations } from 'next-intl/server';

export async function generateMetadata({ params }: { params: IPageParams }) {
  const { locale } = await params;
  setRequestLocale(locale);
  const t = await getTranslations({ locale });

  return {
    title: t('page_about_metadata_title'),
    description: t('page_about_metadata_description'),
  };
}

export default async function AboutUs({
  params,
}: Readonly<{
  params: IPageParams;
}>) {
  const { locale } = await params;
  setRequestLocale(locale);
  const t = await getTranslations({ locale });

  return (
    <main className="mb-10 flex flex-col items-center justify-between">
      <InnerPageBanner
        title={t('pages_about_title')}
        imageSrc={images.aboutBanner.src}
      />
      <AboutTopInfo />
      <AboutDescription className="mb-8 md:mb-14" locale={locale} />
      <HomeStorySection />
    </main>
  );
}
