import { useState } from "react"; import IconPlay from "~/images/icon-play.svg"; import VideoPlayer from "../VideoPlayer/VideoPlayer"; import type { Datum } from "~/types/Videos"; type ViewStyle = "grid grid-3" | "list"; const VideoList = ({ videos }: { videos: Datum[] }) => { const [selectedVideoUrl, setSelectedVideoUrl] = useState(); const [viewStyle, setViewStyle] = useState("grid grid-3"); const handleSelectedVideo = (video: Datum) => { setSelectedVideoUrl(video); }; const handleRemoveVideoPlayer = () => { setSelectedVideoUrl(undefined); }; const handleSetViewstyle = (selectedViewStyle: ViewStyle) => { setViewStyle(selectedViewStyle); }; if (!videos) { return (

No videos found...

If you've already added a channel or playlist, try going to the{" "} downloads page to start the scan and download tasks.

); } return ( <>

Recent Videos

Hide watched:
{/* {% if not hide_watched %} */} {/* {% else %} */} {/* {% endif %} */}
Sort by:
sort-icon console.log("showForm")} id="animate-icon" /> handleSetViewstyle("grid grid-3")} alt="grid view" /> handleSetViewstyle("list")} alt="list view" />
{videos.map((video) => { return (
handleSelectedVideo(video)}>
video-thumb {/* {% if video.source.player.progress %} */}
{/* {% else %} */} {/*
*/} {/* {% endif %} */}
play-icon
{video.player.watched ? ( seen-icon ) : ( unseen-icon )} {video.published} | {video.player.duration_str}
); })}
); }; export default VideoList;