diff --git a/src/components/layout/Seasons.tsx b/src/components/layout/Seasons.tsx index 3e324ad7..e5931dcd 100644 --- a/src/components/layout/Seasons.tsx +++ b/src/components/layout/Seasons.tsx @@ -1,5 +1,6 @@ import { Dropdown } from "components/Dropdown"; import { Episode } from "components/media/EpisodeButton"; +import { WatchedEpisode } from "components/media/WatchedEpisodeButton"; import { useLoading } from "hooks/useLoading"; import { serializePortableMedia } from "hooks/usePortableMedia"; import { @@ -70,9 +71,13 @@ export function Seasons(props: SeasonsProps) { } /> {seasons.seasons[seasonSelected]?.episodes.map((v) => ( - navigateToSeasonAndEpisode(seasonSelected, v.episodeNumber) diff --git a/src/components/media/EpisodeButton.tsx b/src/components/media/EpisodeButton.tsx index 7c7d926c..c4e851d0 100644 --- a/src/components/media/EpisodeButton.tsx +++ b/src/components/media/EpisodeButton.tsx @@ -9,8 +9,8 @@ export function Episode(props: EpisodeProps) { return (
void; + active?: boolean; +} + +export function WatchedEpisode(props: WatchedEpisodeProps) { + const { watched } = useWatchedContext(); + const foundWatched = getWatchedFromPortable(watched.items, props.media); + const watchedPercentage = (foundWatched && foundWatched.percentage) || 0; + + return ( + + ); +}