1.2 KiB
1.2 KiB
GUIDELINES
this folder is part of nextjs typescript project and containing page definition for Customer
/ Customers
record:
- list (./page.tsx)
- view (./[customerId]/page.tsx)
- create (./create/page.tsx)
- edit (./[customerId]/page.tsx)
- translation provided by react-i18next
the @
sign refer to <base_dir>/002_source/002_source/cms/src
Assumption and Requirements
- let one file contains one component only.
- type information defined in
<base_dir>/002_source/cms/src/db/Customers/type.d.tsx
- it mainly consume the db drivers
Customres
in<base_dir>/002_source/cms/src/db/Customers
simple template:
// src/app/dashboard/customers/page.tsx
'use client';
// RULES:
// contains list page for customers (Customers)
// contain definition to collection only
//
import statements here ...
...
...
...
export default function Page({ searchParams }: PageProps): React.JSX.Element {
// ...content
// use direct return of pb.collection (e.g. return pb.collection(xxx))
return (
<>
{* page content *}
</>
)
}
interface PageProps {
searchParams: { email?: string; phone?: string; sortDir?: 'asc' | 'desc'; status?: string };
}