feat(admin): shell admin + dashboard KPI + recherche ⌘K (Sprint 1)
Layout admin : - src/app/admin/layout.tsx : route protégée requireRole(ADMIN), sidebar + topbar + breadcrumbs, data-admin sur racine pour theme sobre indépendant du theme public - Sidebar : 12 sections groupées (Vue d'ensemble, Catalogue, Activité, Membres, Contenu, Système), highlight de la route courante - TopBar : prompt ⌘K, lien vers site public, email admin - Breadcrumbs : auto depuis pathname - CommandPalette : ⌘K / Ctrl K, navigation ↑↓ + Entrée, recherche live debounced 150ms Dashboard : - 7 KPI cards avec tone neutral/ok/warn/info (réservations semaine, confirmées 30j, revenus reversés, occupation, nouveaux users, carbets publiés, avis à modérer) - Section raccourcis fréquents Theme admin : - globals.css : [data-admin] override le background+font, neutralise les borders sépia/papier teinté du theme aquarelle, garantit lisibilité permanente Recherche globale : - lib/admin/search.ts : query parallèle sur Carbet, User, Booking, ContentPage, PirogueProvider (5 résultats par catégorie, LIKE insensitive) - api/admin/search?q=… route handler avec requireRole KPI : - lib/admin/kpis.ts : 7 métriques live (cache 0), Promise.all, helper formatEur Pas de dépendance externe ajoutée (cmdk, shadcn) — composants custom Tailwind pour rester léger.
This commit is contained in:
parent
ffb39a3bf5
commit
bcb93c6b29
11 changed files with 873 additions and 9 deletions
|
|
@ -70,6 +70,23 @@ body[data-theme="aquarelle"] [class*="border-gray-"] {
|
|||
border-color: rgba(140, 61, 24, 0.25);
|
||||
}
|
||||
|
||||
/* === Theme Admin (route /admin/...) === */
|
||||
/* Indépendant des themes publics. Sobre, gris/blanc, accent ocre Karbé,
|
||||
typographie sans-serif neutre. Pas de texture grain. Lisible en
|
||||
permanence peu importe le toggle Aquarelle/Guyane côté site public. */
|
||||
[data-admin] {
|
||||
--background: #fafafa;
|
||||
--foreground: #18181b;
|
||||
font-family: var(--font-geist-sans), system-ui, sans-serif;
|
||||
background-image: none !important;
|
||||
}
|
||||
[data-admin] [class*="border-zinc-"],
|
||||
[data-admin] [class*="border-gray-"] {
|
||||
/* Restaure des borders neutres dans l'admin si theme aquarelle est actif
|
||||
côté body (qui les surcharge en sépia). */
|
||||
border-color: #e4e4e7;
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:root:not([data-theme="guyane"]):not([data-theme="aquarelle"]) {
|
||||
--background: #0a0a0a;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue