fix(website): update all route/layout params to Promise for Next.js 16
Next.js 15+ requires params to be typed as Promise<{...}> and awaited.
Fixed 17 files: all [locale] pages, layouts, and blog [slug] page.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -7,9 +7,9 @@ import { Phone, Mail, MapPin, Clock, MessageSquare, ArrowLeft, ArrowRight } from
|
||||
export async function generateMetadata({
|
||||
params,
|
||||
}: {
|
||||
params: { locale: string };
|
||||
params: Promise<{ locale: string }>;
|
||||
}): Promise<Metadata> {
|
||||
const { locale } = await Promise.resolve(params);
|
||||
const { locale } = await params;
|
||||
const t = await getTranslations({ locale, namespace: "meta" });
|
||||
return { title: t("contactTitle") };
|
||||
}
|
||||
@@ -93,9 +93,9 @@ const en = {
|
||||
export default async function ContactPage({
|
||||
params,
|
||||
}: {
|
||||
params: { locale: string };
|
||||
params: Promise<{ locale: string }>;
|
||||
}) {
|
||||
const { locale } = await Promise.resolve(params);
|
||||
const { locale } = await params;
|
||||
const c = locale === "fa" ? fa : en;
|
||||
const Arrow = locale === "fa" ? ArrowLeft : ArrowRight;
|
||||
const base = `/${locale}`;
|
||||
|
||||
Reference in New Issue
Block a user