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:
@@ -11,8 +11,8 @@ import {
|
||||
|
||||
const BASE_URL = process.env.NEXT_PUBLIC_SITE_URL ?? "https://meezi.ir";
|
||||
|
||||
export async function generateMetadata({ params }: { params: { locale: string } }): Promise<Metadata> {
|
||||
const { locale } = await Promise.resolve(params);
|
||||
export async function generateMetadata({ params }: { params: Promise<{ locale: string }> }): Promise<Metadata> {
|
||||
const { locale } = await params;
|
||||
const t = await getTranslations({ locale, namespace: "meta" });
|
||||
return {
|
||||
title: t("printerGuideTitle"),
|
||||
@@ -247,8 +247,8 @@ const CONNECTION_STEPS_EN = [
|
||||
},
|
||||
];
|
||||
|
||||
export default async function PrinterGuidePage({ params }: { params: { locale: string } }) {
|
||||
const { locale } = await Promise.resolve(params);
|
||||
export default async function PrinterGuidePage({ params }: { params: Promise<{ locale: string }> }) {
|
||||
const { locale } = await params;
|
||||
const isEn = locale === "en";
|
||||
const base = `/${locale}`;
|
||||
const steps = isEn ? CONNECTION_STEPS_EN : CONNECTION_STEPS_FA;
|
||||
|
||||
Reference in New Issue
Block a user