From 939448d15cdfa2a159b7adf5cc04a9009dea304e Mon Sep 17 00:00:00 2001 From: Mathis HERRIOT <197931332+0x485254@users.noreply.github.com> Date: Wed, 21 Jan 2026 15:43:00 +0100 Subject: [PATCH] feat(categories): enhance table UI and add dropdown menu for actions - Improved table responsiveness by hiding columns on smaller screens. - Replaced action buttons with a `DropdownMenu` for better accessibility. - Updated skeleton loaders to match the new table layout. --- .../app/(dashboard)/admin/categories/page.tsx | 62 ++++++++++++------- 1 file changed, 38 insertions(+), 24 deletions(-) diff --git a/frontend/src/app/(dashboard)/admin/categories/page.tsx b/frontend/src/app/(dashboard)/admin/categories/page.tsx index a71b5ab..d1f40c6 100644 --- a/frontend/src/app/(dashboard)/admin/categories/page.tsx +++ b/frontend/src/app/(dashboard)/admin/categories/page.tsx @@ -1,9 +1,17 @@ "use client"; -import { Edit, Plus, Trash2 } from "lucide-react"; +import { Edit, MoreHorizontal, Plus, Trash2 } from "lucide-react"; import Image from "next/image"; import { useCallback, useEffect, useState } from "react"; import { Button } from "@/components/ui/button"; +import { + DropdownMenu, + DropdownMenuContent, + DropdownMenuItem, + DropdownMenuLabel, + DropdownMenuSeparator, + DropdownMenuTrigger, +} from "@/components/ui/dropdown-menu"; import { Skeleton } from "@/components/ui/skeleton"; import { Table, @@ -72,8 +80,8 @@ export default function AdminCategoriesPage() { Nom - Slug - Description + Slug + Description @@ -85,10 +93,10 @@ export default function AdminCategoriesPage() { - + - + @@ -120,28 +128,34 @@ export default function AdminCategoriesPage() { {category.name} - {category.slug} - + + {category.slug} + + {category.description || "Aucune description"} -
- - -
+ + + + + + Actions + + handleEdit(category)}> + Modifier + + handleDelete(category.id)} + className="text-destructive focus:text-destructive" + > + Supprimer + + +
))