From fd1a3faa694622445fbea49d859cc5feb161f3df Mon Sep 17 00:00:00 2001 From: icarus Date: Sun, 12 Oct 2025 03:49:25 +0800 Subject: [PATCH] feat(video): add video list component to display videos Implement VideoList component to show videos from a provider. Replace placeholder div with the new component in VideoPage. --- src/renderer/src/pages/video/VideoList.tsx | 20 ++++++++++++++++++++ src/renderer/src/pages/video/VideoPage.tsx | 3 ++- 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 src/renderer/src/pages/video/VideoList.tsx diff --git a/src/renderer/src/pages/video/VideoList.tsx b/src/renderer/src/pages/video/VideoList.tsx new file mode 100644 index 0000000000..3ade2e6dac --- /dev/null +++ b/src/renderer/src/pages/video/VideoList.tsx @@ -0,0 +1,20 @@ +import { useVideos } from '@renderer/hooks/video/useVideos' +import { Video } from '@renderer/types/video' + +export type VideoListProps = { providerId: string } + +export const VideoList = ({ providerId }: VideoListProps) => { + const { videos } = useVideos(providerId) + return ( +
+ {videos.map((video) => ( + + ))} +
+ ) +} + +const VideoListItem = ({ video }: { video: Video }) => { + // TODO: get thumbnail from video + return
{video.metadata.id}
+} diff --git a/src/renderer/src/pages/video/VideoPage.tsx b/src/renderer/src/pages/video/VideoPage.tsx index deef59d076..46b9b72d13 100644 --- a/src/renderer/src/pages/video/VideoPage.tsx +++ b/src/renderer/src/pages/video/VideoPage.tsx @@ -9,6 +9,7 @@ import { useTranslation } from 'react-i18next' import { ModelSetting } from './settings/ModelSetting' import { ProviderSetting } from './settings/ProviderSetting' +import { VideoList } from './VideoList' import { VideoPanel } from './VideoPanel' export const VideoPage = () => { @@ -31,7 +32,7 @@ export const VideoPage = () => { {/* Video list */} -
+ )