mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-07 05:39:05 +08:00
refactor(VideoViewer): remove unused imports and radio group component
Clean up code by removing unused imports and commented out radio group component
This commit is contained in:
parent
ae54d5d9b9
commit
d5078baa20
@ -1,24 +1,23 @@
|
|||||||
import { Button, Progress, Radio, RadioGroup, Spinner } from '@heroui/react'
|
import { Button, Progress, Spinner } from '@heroui/react'
|
||||||
import { Video, VideoStatus } from '@renderer/types/video'
|
import { Video } from '@renderer/types/video'
|
||||||
import { CheckCircleIcon, CircleXIcon } from 'lucide-react'
|
import { CheckCircleIcon, CircleXIcon } from 'lucide-react'
|
||||||
import { useEffect, useState } from 'react'
|
import { useState } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
|
|
||||||
export interface VideoProps {
|
export interface VideoProps {
|
||||||
video?: Video
|
video?: Video
|
||||||
}
|
}
|
||||||
|
|
||||||
export const VideoViewer = ({ video: _video }: VideoProps) => {
|
export const VideoViewer = ({ video }: VideoProps) => {
|
||||||
const { t } = useTranslation()
|
const { t } = useTranslation()
|
||||||
const [video, setVideo] = useState<Video | undefined>(_video)
|
|
||||||
const [loadSuccess, setLoadSuccess] = useState<boolean | undefined>(undefined)
|
const [loadSuccess, setLoadSuccess] = useState<boolean | undefined>(undefined)
|
||||||
useEffect(() => {
|
// useEffect(() => {
|
||||||
setVideo(_video)
|
// setVideo(_video)
|
||||||
}, [_video])
|
// }, [_video])
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{/* For test */}
|
{/* For test */}
|
||||||
<RadioGroup
|
{/* <RadioGroup
|
||||||
label="Status"
|
label="Status"
|
||||||
value={video?.status ?? 'undefined'}
|
value={video?.status ?? 'undefined'}
|
||||||
onValueChange={(v) => {
|
onValueChange={(v) => {
|
||||||
@ -34,7 +33,7 @@ export const VideoViewer = ({ video: _video }: VideoProps) => {
|
|||||||
<Radio value="downloading">downloading</Radio>
|
<Radio value="downloading">downloading</Radio>
|
||||||
<Radio value="downloaded">downloaded</Radio>
|
<Radio value="downloaded">downloaded</Radio>
|
||||||
<Radio value="failed">failed</Radio>
|
<Radio value="failed">failed</Radio>
|
||||||
</RadioGroup>
|
</RadioGroup> */}
|
||||||
<div className="flex h-full w-full items-center justify-center rounded-2xl bg-foreground-200">
|
<div className="flex h-full w-full items-center justify-center rounded-2xl bg-foreground-200">
|
||||||
{video === undefined && t('video.undefined')}
|
{video === undefined && t('video.undefined')}
|
||||||
{video && video.status === 'queued' && (
|
{video && video.status === 'queued' && (
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user