11import { Metadata } from 'next' ;
22import { getTranslations } from 'next-intl/server' ;
33
4- import { AdminPagination } from '@/components/shop/admin/AdminPagination' ;
5- import { ShopAdminTopbar } from '@/components/shop/admin/ShopAdminTopbar' ;
4+ import { AdminPagination } from '@/components/admin/shop/AdminPagination' ;
65import { getAdminOrdersPage } from '@/db/queries/shop/admin-orders' ;
76import { Link } from '@/i18n/routing' ;
8- import { guardShopAdminPage } from '@/lib/auth/guard-shop-admin-page' ;
97import { parsePage } from '@/lib/pagination' ;
108import { CSRF_FORM_FIELD , issueCsrfToken } from '@/lib/security/csrf' ;
119import {
@@ -20,7 +18,6 @@ export const metadata: Metadata = {
2018 description : 'View and manage orders in the DevLovers shop catalog.' ,
2119} ;
2220
23- export const dynamic = 'force-dynamic' ;
2421
2522const PAGE_SIZE = 25 ;
2623
@@ -50,7 +47,6 @@ export default async function AdminOrdersPage({
5047 params : Promise < { locale : string } > ;
5148 searchParams : Promise < { page ?: string } > ;
5249} ) {
53- await guardShopAdminPage ( ) ;
5450
5551 const { locale } = await params ;
5652 const sp = await searchParams ;
@@ -80,14 +76,12 @@ export default async function AdminOrdersPage({
8076 totalMinor === null ? '-' : formatMoney ( totalMinor , currency , locale ) ,
8177 itemCount : order . itemCount ,
8278 paymentProvider : order . paymentProvider ?? '-' ,
83- viewHref : `/shop/ admin/orders/${ order . id } ` ,
79+ viewHref : `/admin/shop /orders/${ order . id } ` ,
8480 viewAriaLabel : t ( 'viewOrder' , { id : order . id } ) ,
8581 } ;
8682 } ) ;
8783
8884 return (
89- < >
90- < ShopAdminTopbar />
9185
9286 < main
9387 className = "mx-auto max-w-7xl px-4 py-8 sm:px-6 lg:px-8"
@@ -101,7 +95,7 @@ export default async function AdminOrdersPage({
10195 { t ( 'title' ) }
10296 </ h1 >
10397
104- < form action = "/api/shop/admin/orders/reconcile-stale" method = " post" >
98+ < form action = "/api/shop/admin/orders/reconcile-stale" method = ' post' >
10599 < input type = "hidden" name = { CSRF_FORM_FIELD } value = { csrfToken } />
106100 < button
107101 type = "submit"
@@ -302,13 +296,12 @@ export default async function AdminOrdersPage({
302296
303297 < div className = "mt-4" >
304298 < AdminPagination
305- basePath = "/shop/ admin/orders"
299+ basePath = "/admin/shop /orders"
306300 page = { page }
307301 hasNext = { hasNext }
308302 />
309303 </ div >
310304 </ section >
311305 </ main >
312- </ >
313306 ) ;
314307}
0 commit comments