import React, { useEffect, useState } from 'react'; import { usePlayerStore } from '../../store/playerStore'; interface VideoItem { videoId: string; filename: string; } interface Props { onSelect: (videoId: string, filename: string) => void; } export default function VideoList({ onSelect }: Props) { const [videos, setVideos] = useState([]); const { source } = usePlayerStore(); const activeId = source?.kind === 'server' ? source.videoId : null; useEffect(() => { fetch('/api/videos') .then((r) => r.json()) .then(setVideos) .catch(() => {}); }, []); if (videos.length === 0) { return (
서버에 영상이 없습니다
); } return (
{videos.map((v) => ( ))}
); }