import { thumbSrc } from "../api"; import type { LiveDownload } from "../hooks/useDownloads"; import type { FeedItem } from "../types"; import DownloadButton from "./DownloadButton"; import WatchBar from "./WatchBar"; import { clockDuration, compactViews, relativeTime } from "./format"; import { CHANNEL_LINK } from "./ui"; interface Props { item: FeedItem; live?: LiveDownload; online: boolean; onOpen: () => void; /** Jump to this video's channel. */ onOpenChannel: () => void; onDownload: () => void; onCancel: () => void; onDelete: () => void; } export default function VideoRow({ item, live, online, onOpen, onOpenChannel, onDownload, onCancel, onDelete, }: Props) { const downloaded = (live?.state ?? item.state) === "done"; const src = thumbSrc(item, online); return (
  • {[compactViews(item.views), relativeTime(item.published)].filter(Boolean).join(" ยท ")}
    {(live?.error ?? item.error) && (live?.state ?? item.state) === "failed" && (
    {live?.error ?? item.error}
    )}
  • ); }