fixed some ui, refactored code
This commit is contained in:
@@ -1,20 +1,43 @@
|
||||
import type { Metadata } from "next"
|
||||
import OrdersPageClient from "../../../features/orders/components/OrderPage"
|
||||
import type { Metadata, ResolvingMetadata } from "next";
|
||||
import OrdersPageClient from "../../../features/orders/components/OrderPage";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "My Orders | E-Commerce",
|
||||
description: "View your order history",
|
||||
robots: "noindex, nofollow", // Private page
|
||||
}
|
||||
const metadataContent = {
|
||||
tm: {
|
||||
title: "Meniň Sargytlarym | Post shop",
|
||||
description: "Sargytlaryňyzy görüň",
|
||||
},
|
||||
ru: {
|
||||
title: "Мои Заказы | Пост-магазин",
|
||||
description: "Просмотр истории заказов",
|
||||
},
|
||||
} as const;
|
||||
|
||||
interface PageProps {
|
||||
params: Promise<{
|
||||
locale: string
|
||||
}>
|
||||
params: {
|
||||
locale: string;
|
||||
};
|
||||
}
|
||||
|
||||
export async function generateMetadata(
|
||||
{ params }: PageProps,
|
||||
parent: ResolvingMetadata
|
||||
): Promise<Metadata> {
|
||||
const locale = params.locale as keyof typeof metadataContent;
|
||||
|
||||
const content = metadataContent[locale] || metadataContent.ru;
|
||||
|
||||
return {
|
||||
title: content.title,
|
||||
description: content.description,
|
||||
|
||||
robots: {
|
||||
index: false,
|
||||
follow: false,
|
||||
nocache: true,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
export default async function OrdersPage({ params }: PageProps) {
|
||||
const resolvedParams = await params
|
||||
|
||||
return <OrdersPageClient locale={resolvedParams.locale} />
|
||||
return <OrdersPageClient locale={params.locale} />;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user