From 1d2c27abbd2d35d4a3c92c2d78d4dbe1f13fa62b Mon Sep 17 00:00:00 2001 From: JSC Date: Sun, 21 Sep 2025 18:17:55 +0200 Subject: [PATCH] feat: enhance loading states with table structure and improve sound type filtering in SoundsPage --- src/components/tts/TTSList.tsx | 30 ++++++++++- src/components/tts/TTSLoadingStates.tsx | 67 ++++++++++++++++++------- src/pages/SoundsPage.tsx | 2 +- 3 files changed, 78 insertions(+), 21 deletions(-) diff --git a/src/components/tts/TTSList.tsx b/src/components/tts/TTSList.tsx index 813a994..b11a65c 100644 --- a/src/components/tts/TTSList.tsx +++ b/src/components/tts/TTSList.tsx @@ -176,7 +176,35 @@ export function TTSList() { {Array.from({ length: 5 }).map((_, i) => ( - +
+
+ {/* Badges row */} +
+ + +
+ + {/* Text content */} +
+ +
+ + +
+
+ + {/* Date and metadata */} +
+ + +
+
+ + {/* Play button */} +
+ +
+
))} diff --git a/src/components/tts/TTSLoadingStates.tsx b/src/components/tts/TTSLoadingStates.tsx index 3e62060..c9940af 100644 --- a/src/components/tts/TTSLoadingStates.tsx +++ b/src/components/tts/TTSLoadingStates.tsx @@ -1,32 +1,61 @@ import { Button } from '@/components/ui/button' import { Card, CardContent } from '@/components/ui/card' import { Skeleton } from '@/components/ui/skeleton' +import { + Table, + TableBody, + TableCell, + TableHead, + TableHeader, + TableRow, +} from '@/components/ui/table' import { AlertCircle, Mic, RefreshCw } from 'lucide-react' export function TTSLoading() { return ( -
- {Array.from({ length: 5 }).map((_, i) => ( - - -
-
-
- - -
+
+ + + + Text + Provider + Options + Status + Created + Actions + + + + {Array.from({ length: 5 }).map((_, i) => ( + + + + + + +
- - + +
- - - - - - - ))} +
+ + + + + + + +
+ + +
+
+
+ ))} +
+
) } diff --git a/src/pages/SoundsPage.tsx b/src/pages/SoundsPage.tsx index ab723d4..73fb794 100644 --- a/src/pages/SoundsPage.tsx +++ b/src/pages/SoundsPage.tsx @@ -163,7 +163,7 @@ export function SoundsPage() { setError(null) // Determine types to filter by - const types = typeFilter === 'all' ? undefined : [typeFilter] + const types = typeFilter === 'all' ? ['SDB', 'TTS'] : [typeFilter] const sounds = await soundsService.getSounds({ types,