diff --git a/src/containers/PodcastShowContainer.tsx b/src/containers/PodcastShowContainer.tsx index 29e6517..771d0e5 100644 --- a/src/containers/PodcastShowContainer.tsx +++ b/src/containers/PodcastShowContainer.tsx @@ -16,14 +16,23 @@ interface Props { } const PodcastShowContainer = (props: Props) => { - const { show, latestEpisodes, highlightedEpisodes } = props + const { show } = props const query = useRecentEpisodes({ limit: 8, showSlug: show.slug, - initialData: latestEpisodes, + initialData: props.latestEpisodes, }) + const highlightedPosts = [...props.highlightedEpisodes, ...query.posts].slice( + 0, + 2, + ) + + const latestPosts = query.posts.filter( + (post) => !highlightedPosts.includes(post), + ) + return ( <> @@ -33,7 +42,7 @@ const PodcastShowContainer = (props: Props) => { All episodes} bordered="except-first-row" pattern={[ @@ -59,10 +68,8 @@ const PodcastShowContainer = (props: Props) => { 0 ? true : 'except-first-row' - } + episodes={latestPosts} + bordered={highlightedPosts.length > 0 ? true : 'except-first-row'} pattern={[ { cols: 4,