From dc19c175269f8b83cafb7884a3f0860c79e9025b Mon Sep 17 00:00:00 2001 From: icarus Date: Sun, 12 Oct 2025 03:13:23 +0800 Subject: [PATCH] feat(video): add status handling and error messages to video player - Add new i18n strings for video status and error messages - Implement status-based UI rendering with progress indicators - Include test radio group for status simulation --- src/renderer/src/i18n/locales/en-us.json | 7 ++ src/renderer/src/pages/video/VideoPlayer.tsx | 72 +++++++++++++++++--- 2 files changed, 71 insertions(+), 8 deletions(-) diff --git a/src/renderer/src/i18n/locales/en-us.json b/src/renderer/src/i18n/locales/en-us.json index f9558ec55d..6197dec5fb 100644 --- a/src/renderer/src/i18n/locales/en-us.json +++ b/src/renderer/src/i18n/locales/en-us.json @@ -4652,6 +4652,13 @@ "prompt": { "placeholder": "describes the video to generate" }, + "status": { + "completed": "Generation Completed", + "downloading": "Downloading", + "failed": "Failed to generate video", + "in_progress": "Generating", + "queued": "Queued" + }, "title": "Video", "undefined": "No available video" }, diff --git a/src/renderer/src/pages/video/VideoPlayer.tsx b/src/renderer/src/pages/video/VideoPlayer.tsx index 25cf63f896..9aa2759760 100644 --- a/src/renderer/src/pages/video/VideoPlayer.tsx +++ b/src/renderer/src/pages/video/VideoPlayer.tsx @@ -1,22 +1,78 @@ -import { Video } from '@renderer/types/video' -import { CircleXIcon } from 'lucide-react' +import { Progress, Radio, RadioGroup, Spinner } from '@heroui/react' +import { Video, VideoStatus } from '@renderer/types/video' +import { CheckCircleIcon, CircleXIcon } from 'lucide-react' +import { useState } from 'react' import { useTranslation } from 'react-i18next' export interface VideoProps { - video?: Video | null + video?: Video } -export const VideoPlayer = ({ video }: VideoProps) => { +export const VideoPlayer = ({ video: _video }: VideoProps) => { const { t } = useTranslation() + const [video, setVideo] = useState