From 41659c9299f59e04d359a1b377c43e468c2ac682 Mon Sep 17 00:00:00 2001 From: JSC Date: Sun, 21 Sep 2025 15:39:04 +0200 Subject: [PATCH] feat: add badge to display sound type in SoundCard component --- src/components/sounds/SoundCard.tsx | 32 ++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/src/components/sounds/SoundCard.tsx b/src/components/sounds/SoundCard.tsx index 0289cfa..c2f533e 100644 --- a/src/components/sounds/SoundCard.tsx +++ b/src/components/sounds/SoundCard.tsx @@ -1,4 +1,5 @@ import { Card, CardContent } from '@/components/ui/card' +import { Badge } from '@/components/ui/badge' import { type Sound } from '@/lib/api/services/sounds' import { cn } from '@/lib/utils' import { formatDuration } from '@/utils/format-duration' @@ -27,6 +28,19 @@ export function SoundCard({ sound, playSound, onFavoriteToggle, colorClasses }: onFavoriteToggle(sound.id, !sound.is_favorited) } + const getBadgeVariant = (type: Sound['type']) => { + switch (type) { + case 'SDB': + return 'default' + case 'TTS': + return 'secondary' + case 'EXT': + return 'outline' + default: + return 'default' + } + } + return ( + {/* Type badge */} + + {sound.type} + + {/* Favorite button */} -

{sound.name}

+

{sound.name}