mirror of
https://github.com/JetSprow/J-Board-Lite.git
synced 2026-05-01 09:14:11 +05:30
Initial commit
This commit is contained in:
35
src/app/(user)/orders/page.tsx
Normal file
35
src/app/(user)/orders/page.tsx
Normal file
@@ -0,0 +1,35 @@
|
||||
import type { Metadata } from "next";
|
||||
import { getServerSession } from "next-auth";
|
||||
import { authOptions } from "@/lib/auth";
|
||||
import { Pagination } from "@/components/shared/pagination";
|
||||
import { PageHeader, PageShell } from "@/components/shared/page-shell";
|
||||
import { UserOrdersTable } from "./_components/user-orders-table";
|
||||
import { getUserOrders } from "./orders-data";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "我的订单",
|
||||
description: "查看新购、续费和增流量订单记录。",
|
||||
};
|
||||
|
||||
export default async function UserOrdersPage({
|
||||
searchParams,
|
||||
}: {
|
||||
searchParams: Promise<Record<string, string | string[] | undefined>>;
|
||||
}) {
|
||||
const session = await getServerSession(authOptions);
|
||||
const { orders, total, page, pageSize } = await getUserOrders({
|
||||
userId: session!.user.id,
|
||||
searchParams: await searchParams,
|
||||
});
|
||||
|
||||
return (
|
||||
<PageShell>
|
||||
<PageHeader
|
||||
eyebrow="订单记录"
|
||||
title="我的订单"
|
||||
/>
|
||||
<UserOrdersTable orders={orders} />
|
||||
<Pagination total={total} pageSize={pageSize} page={page} />
|
||||
</PageShell>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user