This commit is contained in:
louiscklaw
2025-04-24 01:08:44 +08:00
parent 41cc82d54d
commit da08798b10
87 changed files with 66682 additions and 6003 deletions

View File

@@ -0,0 +1,49 @@
# 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:
```typescript
// 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 };
}
```