From c3f57db1e5030661871e94ce1bf9b4f2b3a9694c Mon Sep 17 00:00:00 2001 From: Mathis HERRIOT <197931332+0x485254@users.noreply.github.com> Date: Wed, 21 Jan 2026 15:43:09 +0100 Subject: [PATCH] feat(contents): improve table responsiveness and replace action buttons with dropdown menu - Enhanced table layout by hiding columns on smaller screens for better responsiveness. - Replaced action buttons with `DropdownMenu` for improved accessibility and cleaner UI. - Adjusted skeleton loaders to align with the updated table structure. --- .../app/(dashboard)/admin/contents/page.tsx | 73 +++++++++++-------- 1 file changed, 44 insertions(+), 29 deletions(-) diff --git a/frontend/src/app/(dashboard)/admin/contents/page.tsx b/frontend/src/app/(dashboard)/admin/contents/page.tsx index e614d1c..ed27957 100644 --- a/frontend/src/app/(dashboard)/admin/contents/page.tsx +++ b/frontend/src/app/(dashboard)/admin/contents/page.tsx @@ -7,12 +7,21 @@ import { Edit, Eye, Image as ImageIcon, + MoreHorizontal, Trash2, Video, } from "lucide-react"; import { useCallback, useEffect, useState } from "react"; import { Badge } from "@/components/ui/badge"; 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, @@ -77,10 +86,10 @@ export default function AdminContentsPage() { Contenu - Catégorie - Auteur - Stats - Date + Catégorie + Auteur + Stats + Date @@ -92,16 +101,16 @@ export default function AdminContentsPage() { - + - + - + - + @@ -135,13 +144,15 @@ export default function AdminContentsPage() { - + {content.category?.name || "Sans catégorie"} - @{content.author.username} - + + @{content.author.username} + + {content.views} @@ -151,27 +162,31 @@ export default function AdminContentsPage() { - + {format(new Date(content.createdAt), "dd/MM/yyyy", { locale: fr })} - - handleEdit(content)} - > - - - handleDelete(content.id)} - className="text-destructive hover:text-destructive hover:bg-destructive/10" - > - - - + + + + + Actions + + + + Actions + + handleEdit(content)}> + Modifier + + handleDelete(content.id)} + className="text-destructive focus:text-destructive" + > + Supprimer + + + ))