From 81f186abd648a741653c441cd06a54ba9497758d Mon Sep 17 00:00:00 2001 From: icarus Date: Mon, 13 Oct 2025 20:04:37 +0800 Subject: [PATCH] feat(video): add status label helper function for video items Add getStatusLabel function to centralize status text display logic and improve consistency. The function handles all status cases including empty states for 'downloaded' status. --- .../src/pages/video/VideoListItem.tsx | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/renderer/src/pages/video/VideoListItem.tsx b/src/renderer/src/pages/video/VideoListItem.tsx index 1dd20e248c..985812a265 100644 --- a/src/renderer/src/pages/video/VideoListItem.tsx +++ b/src/renderer/src/pages/video/VideoListItem.tsx @@ -52,6 +52,25 @@ export const VideoListItem = ({ } } + const getStatusLabel = () => { + switch (video.status) { + case 'queued': + return t('video.status.queued') + case 'in_progress': + return t('video.status.in_progress') + case 'completed': + return t('video.status.completed') + case 'downloading': + return t('video.status.downloading') + case 'downloaded': + return '' + case 'failed': + return t('video.status.failed') + default: + return '' + } + } + const showProgress = video.status === 'in_progress' || video.status === 'downloading' const showThumbnail = (video.status === 'completed' || video.status === 'downloading' || video.status === 'downloaded') && @@ -82,7 +101,7 @@ export const VideoListItem = ({ {getStatusIcon() && (
{getStatusIcon()} - {t(`video.status.${video.status}`)} + {getStatusLabel()}
)}