import { IProjectCardProps } from '@/app/api/projects/data';
import images from '@/assets/images/images';
import InnerPageBanner from '@/components/layout/innerPages/banner';
import ProjectsGrid from '@/components/pages/project/ProjectGrid';
import ProjectsGridView from '@/components/pages/project/projectGridView';
import { IPageParams } from '@/models/layout';
import { getProjects } from '@/services/projects';
import { getTranslations, setRequestLocale } from 'next-intl/server';
import Head from 'next/head';

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

  return {
    title: t('page_projects_metadata_title'),
    description: t('page_projects_metadata_description'),
  };
}
export default async function ProjectsPage({
  params,
}: {
  params: IPageParams;
}) {
  const { locale } = await params;
  const t = await getTranslations({ locale });
  const projects: IProjectCardProps[] = await getProjects();
  return (
    <main>
      <InnerPageBanner
        title={t('pages_projects_title')}
        imageSrc={images.aboutBanner.src}
      />
      <div className="container-fluid mx-auto my-24">
        <ProjectsGridView />
      </div>
    </main>
  );
}
