From 73556894f8e1b02897886ea33143626ed3c0be11 Mon Sep 17 00:00:00 2001 From: Mathis HERRIOT <197931332+0x485254@users.noreply.github.com> Date: Wed, 21 Jan 2026 15:42:35 +0100 Subject: [PATCH] feat(content-card): improve UI and add tooltips for interaction elements - Introduced tooltips for like, views, and share buttons for better user guidance. - Added support for category display and improved tag styling. - Adjusted `CardContent` aspect ratios for better responsiveness. - Enhanced share button functionality with copy-to-clipboard feedback. --- frontend/src/components/content-card.tsx | 99 ++++++++++++++++++------ 1 file changed, 77 insertions(+), 22 deletions(-) diff --git a/frontend/src/components/content-card.tsx b/frontend/src/components/content-card.tsx index cac2a3b..75c4de1 100644 --- a/frontend/src/components/content-card.tsx +++ b/frontend/src/components/content-card.tsx @@ -21,6 +21,12 @@ import { DropdownMenuItem, DropdownMenuTrigger, } from "@/components/ui/dropdown-menu"; +import { + Tooltip, + TooltipContent, + TooltipProvider, + TooltipTrigger, +} from "@/components/ui/tooltip"; import { useAuth } from "@/providers/auth-provider"; import { ContentService } from "@/services/content.service"; import { FavoriteService } from "@/services/favorite.service"; @@ -88,7 +94,12 @@ export function ContentCard({ content, onUpdate }: ContentCardProps) { try { await ContentService.remove(content.id); toast.success("Mème supprimé !"); - onUpdate?.(); + if (onUpdate) { + onUpdate(); + } else { + // Si pas de onUpdate, on est probablement sur la page de détail + router.push("/"); + } } catch (_error) { toast.error("Erreur lors de la suppression."); } @@ -147,7 +158,7 @@ export function ContentCard({ content, onUpdate }: ContentCardProps) { - + {content.mimeType.startsWith("image/") ? ( ) : (