import { convertMediaToPortable, getProviderFromId, MWMediaMeta, MWMediaType, } from "providers"; import { Link } from "react-router-dom"; import { Icon, Icons } from "components/Icon"; import { serializePortableMedia } from "hooks/usePortableMedia"; import { DotList } from "components/text/DotList"; export interface MediaCardProps { media: MWMediaMeta; watchedPercentage: number; linkable?: boolean; } function MediaCardContent({ media, linkable, watchedPercentage, }: MediaCardProps) { const provider = getProviderFromId(media.providerId); if (!provider) { return null; } return (
{/* progress background */} {watchedPercentage > 0 ? (
) : null}
{/* card content */}

{media.title}

{/* hoverable chevron */}
); } export function MediaCard(props: MediaCardProps) { let link = "movie"; if (props.media.mediaType === MWMediaType.SERIES) link = "series"; const content = ; if (!props.linkable) return {content}; return ( {content} ); }