docs(modules): document AdminHeader component usage and clarify admin/components exports
This commit is contained in:
+44
-1
@@ -168,6 +168,49 @@ registerPage({ slug: 'blog', Component: BlogAdminPage, title: 'Blog' });
|
||||
|
||||
Rendue sous `/admin/blog`.
|
||||
|
||||
Pour l'en-tête des pages admin (titre, description, bouton retour, action), utiliser `AdminHeader` importé depuis `@zen/core/features/admin/components` :
|
||||
|
||||
```js
|
||||
'use client';
|
||||
import { AdminHeader } from '@zen/core/features/admin/components';
|
||||
|
||||
// Page liste avec bouton d'action
|
||||
export default function BlogListPage() {
|
||||
return (
|
||||
<div className="flex flex-col gap-6">
|
||||
<AdminHeader
|
||||
title="Billets"
|
||||
description="Billets disponibles."
|
||||
action={<Button onClick={...}>Créer un billet</Button>}
|
||||
/>
|
||||
{/* ... */}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
// Page formulaire avec bouton retour
|
||||
export default function BlogCreatePage() {
|
||||
return (
|
||||
<div className="flex flex-col gap-6">
|
||||
<AdminHeader
|
||||
title="Créer un billet"
|
||||
description="Remplir les champs et enregistrer."
|
||||
backHref="/admin/blog"
|
||||
/>
|
||||
{/* ... */}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
```
|
||||
|
||||
| Prop | Type | Description |
|
||||
|------|------|-------------|
|
||||
| `title` | `string` | Titre de la page. |
|
||||
| `description` | `string` | Sous-titre optionnel. |
|
||||
| `backHref` | `string` | Si fourni, affiche un bouton « ← Retour » qui navigue vers cette URL. |
|
||||
| `backLabel` | `string` | Label du bouton retour (défaut : `← Retour`). |
|
||||
| `action` | `ReactNode` | Élément affiché à droite (bouton créer, etc.). |
|
||||
|
||||
### Widgets dashboard
|
||||
|
||||
```js
|
||||
@@ -312,7 +355,7 @@ Sous-entrées explicitement safe pour un import depuis un fichier `'use client'`
|
||||
|-------------|---------|
|
||||
| `@zen/core/users/constants` | `PERMISSIONS`, `PERMISSION_DEFINITIONS`, `getPermissionGroups` — aucun import serveur. |
|
||||
| `@zen/core/features/admin` | `registerPage`, `registerWidget`, `registerNavItem`, `registerNavSection`, `buildNavigationSections`. Neutre côté boundary. |
|
||||
| `@zen/core/features/admin/components` | Composants client. |
|
||||
| `@zen/core/features/admin/components` | Composants client : `AdminHeader`, `AdminShell`, `AdminSidebar`, `ThemeToggle`, modals. |
|
||||
| `@zen/core/themes` | Tokens/utilitaires de thème. |
|
||||
| `@zen/core/toast` | API toast côté client. |
|
||||
| `@zen/core/shared/icons` | Composants d'icônes. |
|
||||
|
||||
Reference in New Issue
Block a user