import { useState } from "react"; import IconPlay from "~/images/icon-play.svg"; import type { Videos } from "~/routes/index"; import type { Datum } from "~/types/Videos"; import VideoPlayer from "../VideoPlayer/VideoPlayer"; type ViewStyle = "grid grid-3" | "list"; const VideoList = ({ videos }: { videos: Videos }) => { 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.length < 1) { 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;