fix: remove fake module data
This commit is contained in:
@@ -158,6 +158,48 @@ The project Dialog adapter must:
|
||||
- Browser validation should assert the panel center is within 2px of the viewport center
|
||||
on desktop and mobile.
|
||||
|
||||
### Static Module Data Contract
|
||||
|
||||
Static or reserved module pages must not fabricate operational data. If a module does
|
||||
not have a Drizzle-backed query/API and real persisted records, render a clear empty or
|
||||
not-connected state instead of generated counters, fake workflows, sample records, or
|
||||
mock priority/status rows.
|
||||
|
||||
`modules/shared/components/ModulePage.tsx` is the shared placeholder for these modules.
|
||||
Its props should stay descriptive only:
|
||||
|
||||
```typescript
|
||||
type ModulePageProps = {
|
||||
title: string;
|
||||
eyebrow: string;
|
||||
description: string;
|
||||
icon: LucideIcon;
|
||||
phase: "待接入" | "二期预留" | "三期预留";
|
||||
};
|
||||
```
|
||||
|
||||
```typescript
|
||||
// Bad: static pages pretending to have live business data.
|
||||
<ModulePage
|
||||
title="Care"
|
||||
metrics={[{ label: "Today", value: "184", detail: "142 done" }]}
|
||||
workflows={["Create plan", "Dispatch task"]}
|
||||
/>
|
||||
|
||||
// Good: no fabricated records until a real data source exists.
|
||||
<ModulePage
|
||||
title="Care"
|
||||
eyebrow="Plans and inspections"
|
||||
description="Pending connection to care plans, task dispatch, and execution records."
|
||||
icon={ClipboardCheck}
|
||||
phase="待接入"
|
||||
/>
|
||||
```
|
||||
|
||||
When a module becomes real, replace the placeholder with a Server Component that loads
|
||||
data from the server boundary and pass only persisted, permission-filtered data into
|
||||
client components.
|
||||
|
||||
### Use Proper Elements
|
||||
|
||||
```typescript
|
||||
|
||||
Reference in New Issue
Block a user