From ed767485f2e95d90f1f1c1d2e0f1d77987c97f53 Mon Sep 17 00:00:00 2001 From: JSC Date: Tue, 8 Jul 2025 15:29:03 +0200 Subject: [PATCH] feat: replace inline formatDuration function with imported utility for better code reuse --- src/pages/SoundboardPage.tsx | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/pages/SoundboardPage.tsx b/src/pages/SoundboardPage.tsx index 73ca28d..e587e34 100644 --- a/src/pages/SoundboardPage.tsx +++ b/src/pages/SoundboardPage.tsx @@ -6,6 +6,7 @@ import { toast } from 'sonner'; import { apiService } from '@/services/api'; import { AddUrlDialog } from '@/components/AddUrlDialog'; import { useAddUrlShortcut } from '@/hooks/use-keyboard-shortcuts'; +import { formatDuration } from '@/lib/format-duration'; interface Sound { id: number; @@ -29,12 +30,6 @@ const SoundCard: React.FC = ({ sound, onPlay, isPlaying }) => { onPlay(sound.id); }; - const formatDuration = (seconds: number) => { - const mins = Math.floor(seconds / 60); - const secs = seconds % 60; - return `${mins}:${secs.toString().padStart(2, '0')}`; - }; - return (