import { convertMediaToPortable, getProviderFromId, MWMedia, MWMediaType, } from "providers"; import { Link } from "react-router-dom"; import { Icon, Icons } from "components/Icon"; import { serializePortableMedia } from "hooks/usePortableMedia"; export interface MediaCardProps { media: MWMedia; watchedPercentage: Number; linkable?: boolean; } export interface MediaMetaProps { content: string[]; } function MediaMeta(props: MediaMetaProps) { return (

{props.content.map((item, index) => ( {index !== 0 ? ( ) : null} {item} ))}

); } 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} ); }