-
-
setForm({ ...form, ordre: parseInt(e.target.value) || 0 })}
- className="w-full rounded-xl border border-gray-300 dark:border-gray-700 bg-white dark:bg-gray-900 text-gray-900 dark:text-gray-100 px-4 py-2.5 focus:outline-none focus:ring-2 focus:ring-candlelight-500"
- />
+
+
-
-
-
-
-
+
+ -
+
+
+ -
+
+
+
diff --git a/frontend/src/app/(admin)/admin/dashboard/page.tsx b/frontend/src/app/(admin)/admin/dashboard/page.tsx
index 6d4f564..2d1a3a6 100644
--- a/frontend/src/app/(admin)/admin/dashboard/page.tsx
+++ b/frontend/src/app/(admin)/admin/dashboard/page.tsx
@@ -2,8 +2,6 @@
import { useEffect, useState } from 'react';
import Link from 'next/link';
-import { Users, FileText, Heart } from 'lucide-react';
-import Card from '@/components/ui/Card';
import api from '@/lib/api';
interface AdminStats {
@@ -41,86 +39,63 @@ export default function AdminDashboardPage() {
}, []);
const statCards = [
- {
- label: 'Utilisateurs',
- value: stats?.total_utilisateurs || 0,
- icon:
,
- color: 'text-blue-500',
- bg: 'bg-blue-50 dark:bg-blue-950/30',
- },
- {
- label: 'Articles',
- value: stats?.total_feeds || 0,
- icon:
,
- color: 'text-malachite-500',
- bg: 'bg-malachite-50 dark:bg-malachite-950/30',
- },
- {
- label: 'Émotions',
- value: stats?.total_emotions || 0,
- icon:
,
- color: 'text-candlelight-500',
- bg: 'bg-candlelight-50 dark:bg-candlelight-950/30',
- },
+ { label: 'Utilisateurs', value: stats?.total_utilisateurs || 0, icon: 'fr-icon-user-line' },
+ { label: 'Articles', value: stats?.total_feeds || 0, icon: 'fr-icon-article-line' },
+ { label: 'Émotions', value: stats?.total_emotions || 0, icon: 'fr-icon-heart-line' },
+ ];
+
+ const quickActions = [
+ { href: '/admin/utilisateurs', icon: 'fr-icon-user-line', label: 'Gérer les utilisateurs' },
+ { href: '/admin/contenus', icon: 'fr-icon-article-line', label: 'Gérer les contenus' },
+ { href: '/admin/emotions', icon: 'fr-icon-heart-line', label: 'Gérer les émotions' },
];
return (
-
-
- Administration
-
-
- Vue d'ensemble de la plateforme CESIZen
-
-
+
Administration
+
+ Vue d'ensemble de la plateforme CESIZen
+
-
+
{statCards.map((card) => (
-
-
-
- {card.icon}
-
-
-
{card.label}
-
- {loading ? '...' : card.value}
-
+
+
+
+
+
+
+ {card.label}
+
+
+ {loading ? '…' : card.value}
+
+
-
+
))}
-
-
- Actions rapides
-
-
-
-
- Gérer les utilisateurs
-
-
-
- Gérer les contenus
-
-
-
- Gérer les émotions
-
-
-
+
Actions rapides
+
+ {quickActions.map((action) => (
+
+
+
+
+
+
+
+ {action.label}
+
+
+
+
+
+
+ ))}
+
);
}
diff --git a/frontend/src/app/(admin)/admin/emotions/page.tsx b/frontend/src/app/(admin)/admin/emotions/page.tsx
index 6ab69b0..50a80a4 100644
--- a/frontend/src/app/(admin)/admin/emotions/page.tsx
+++ b/frontend/src/app/(admin)/admin/emotions/page.tsx
@@ -1,13 +1,10 @@
'use client';
import { useEffect, useState } from 'react';
-import { Plus, Edit2, Trash2 } from 'lucide-react';
import api from '@/lib/api';
import type { Emotion } from '@/types';
-import Card from '@/components/ui/Card';
import Button from '@/components/ui/Button';
import Input from '@/components/ui/Input';
-import Badge from '@/components/ui/Badge';
import Modal from '@/components/ui/Modal';
import toast from 'react-hot-toast';
@@ -100,193 +97,268 @@ export default function AdminEmotionsPage() {
}
};
+ const colorSwatch = (couleur: string) => (
+
+ );
+
return (
-
-
-
- Émotions
-
-
- Gérez le catalogue des émotions disponibles
+
+
+
Émotions
+
+ Gérez le catalogue des émotions disponibles (2 niveaux)
-
+
+
+
{loading ? (
-
- {Array.from({ length: 4 }).map((_, i) => (
-
-
-
- ))}
-
+
Chargement…
) : emotions.length === 0 ? (
-
- Aucune émotion
-
-
+
+
Aucune émotion pour le moment.
+
+
) : (
-
- {parentEmotions.map((emotion) => (
-
-
-
- {emotion.icone || '🔵'}
-
-
-
-
- {emotion.nom}
-
- {emotion.couleur}
- {!emotion.est_actif && (
- Inactif
- )}
-
-
Niveau 1
-
-
-
-
-
-
-
-
- {/* Sous-émotions */}
- {emotion.enfants && emotion.enfants.length > 0 && (
-
- {emotion.enfants.map((child) => (
-
-
{child.icone || '🔵'}
-
- {child.nom}
-
-
- {!child.est_actif &&
Inactif}
-
-
-
- ))}
-
- )}
-
- ))}
+
+
+
+
+ | Émotion |
+ Niveau |
+ Couleur |
+ Statut |
+ Actions |
+
+
+
+ {parentEmotions.map((emotion) => (
+
+ ))}
+
+
)}
{/* Modal création/édition */}
setModalOpen(false)} title={editingEmotion ? 'Modifier l\'émotion' : 'Nouvelle émotion'}>
-