diff --git a/frontend/src/components/features/EmotionChart.tsx b/frontend/src/components/features/EmotionChart.tsx
index a824a51..800c199 100644
--- a/frontend/src/components/features/EmotionChart.tsx
+++ b/frontend/src/components/features/EmotionChart.tsx
@@ -12,8 +12,6 @@ import {
PieChart,
Pie,
Cell,
- LineChart,
- Line,
Legend,
} from 'recharts';
import type { ValueType, NameType } from 'recharts/types/component/DefaultTooltipContent';
@@ -90,10 +88,10 @@ export default function EmotionChart({ data, type = 'repartition' }: EmotionChar
return (
-
+
-
+
{data.evolution.emotions.map((emotion) => (
-
))}
-
+
);
diff --git a/frontend/src/components/layout/Header.tsx b/frontend/src/components/layout/Header.tsx
index d5d1646..7dc5517 100644
--- a/frontend/src/components/layout/Header.tsx
+++ b/frontend/src/components/layout/Header.tsx
@@ -1,8 +1,10 @@
"use client";
+import { useState } from "react";
import Link from "next/link";
-import { usePathname } from "next/navigation";
+import { usePathname, useRouter } from "next/navigation";
import { useAuthStore } from "@/lib/auth-store";
+import ConfirmDialog from "@/components/ui/ConfirmDialog";
interface NavLink {
href: string;
@@ -11,9 +13,17 @@ interface NavLink {
export default function Header() {
const pathname = usePathname();
+ const router = useRouter();
const { user, token, logout } = useAuthStore();
const isAuthenticated = !!token;
const isAdmin = user?.role?.nom === "administrateur";
+ const [showLogoutConfirm, setShowLogoutConfirm] = useState(false);
+
+ const handleLogout = async () => {
+ setShowLogoutConfirm(false);
+ await logout();
+ router.push("/connexion");
+ };
const navLinks: NavLink[] = [
{ href: "/", label: "Accueil" },
@@ -83,7 +93,7 @@ export default function Header() {
@@ -155,6 +165,15 @@ export default function Header() {
+ setShowLogoutConfirm(false)}
+ />
);
}