import { BlogCard } from "@/app/[locale]/blog/BlogCard"; import { Locale, LOCALES } from "@/i18n/routing"; import { getPosts } from "@/lib/getBlogs"; import { constructMetadata } from "@/lib/metadata"; import { Metadata } from "next"; import { getTranslations } from "next-intl/server"; type Params = Promise<{ locale: string }>; type MetadataProps = { params: Params; }; export async function generateMetadata({ params, }: MetadataProps): Promise { const { locale } = await params; const t = await getTranslations({ locale, namespace: "Blog" }); return constructMetadata({ page: "Blog", title: t("title"), description: t("description"), locale: locale as Locale, path: `/blog`, canonicalUrl: `/blog`, }); } export default async function Page({ params }: { params: Params }) { const { locale } = await params; const { posts } = await getPosts(locale); const t = await getTranslations("Blog"); return (

{t("title")}

{posts.map((post) => ( ))}
); } export async function generateStaticParams() { return LOCALES.map((locale) => ({ locale })); }