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; series?: boolean; } function MediaCardContent({ media, linkable, watchedPercentage, series, }: MediaCardProps) { const provider = getProviderFromId(media.providerId); if (!provider) { return null; } return (
{/* progress background */} {watchedPercentage > 0 ? (
) : null}
{/* card content */}

{media.title} {series && media.seasonId && media.episodeId ? ( S{media.seasonId} E{media.episodeId} ) : null}

{/* 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} ); }