You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
696 B
23 lines
696 B
import { MWMediaMeta } from "providers"; |
|
import { useWatchedContext, getWatchedFromPortable } from "state/watched"; |
|
import { MediaCard } from "./MediaCard"; |
|
|
|
export interface WatchedMediaCardProps { |
|
media: MWMediaMeta; |
|
series?: boolean; |
|
} |
|
|
|
export function WatchedMediaCard(props: WatchedMediaCardProps) { |
|
const { watched } = useWatchedContext(); |
|
const foundWatched = getWatchedFromPortable(watched.items, props.media); |
|
const watchedPercentage = (foundWatched && foundWatched.percentage) || 0; |
|
|
|
return ( |
|
<MediaCard |
|
watchedPercentage={watchedPercentage} |
|
media={props.media} |
|
series={props.series && props.media.episodeId !== undefined} |
|
linkable |
|
/> |
|
); |
|
}
|
|
|