import { getProviderFromId, MWMedia, MWMediaType } from "scrapers"; import { Link } from "react-router-dom"; import { Icon, Icons } from "components/Icon"; 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.MOVIE) link = "series"; const content = ; if (!props.linkable) return {content}; return {content}; }