import { MWMediaMeta } from "@/backend/metadata/types"; import { IconPatch } from "@/components/buttons/IconPatch"; import { Icons } from "@/components/Icon"; import { Title } from "@/components/text/Title"; import { ReactNode } from "react"; import { useVideoPlayerState } from "../VideoContext"; import { VideoPlayerHeader } from "./VideoPlayerHeader"; interface VideoPlayerErrorProps { media?: MWMediaMeta; onGoBack?: () => void; children?: ReactNode; } export function VideoPlayerError(props: VideoPlayerErrorProps) { const { videoState } = useVideoPlayerState(); const err = videoState.error; if (!err) return props.children as any; return (
{err.name}: {err.description}