feat: render description's html

chore: refactor to get episodes data from rss feed
This commit is contained in:
2024-04-20 16:58:52 +02:00
parent 8daddc383f
commit 730090ca9e
14 changed files with 1718 additions and 1351 deletions

View File

@@ -1,15 +1,11 @@
import { Outlet, useParams } from "react-router-dom";
import {
usePodcastEpisodesQuery,
useTopPodcastsQuery,
} from "../services/podcasts/podcast.hooks";
import { usePodcastQuery } from "../services/podcasts/podcast.hooks";
import { PodcastInfoCard } from "../components/podcast-info-card";
export function Podcast() {
const { podcastId } = useParams<{ podcastId: string }>();
const { data: podcasts } = useTopPodcastsQuery();
const { data: episodesData } = usePodcastEpisodesQuery(podcastId);
const { data: podcast } = usePodcastQuery(podcastId);
if (!podcastId) {
throw new Error(
@@ -17,12 +13,6 @@ export function Podcast() {
);
}
if (!podcasts) {
return null;
}
const podcast = podcasts.find((podcast) => podcast.id === podcastId);
if (!podcast) {
return <h1>Podcast not found</h1>;
}
@@ -33,7 +23,7 @@ export function Podcast() {
author={podcast.author}
title={podcast.title}
description={podcast.description}
imageURL={episodesData?.podcast.images.large ?? ""}
imageURL={podcast.images.large}
/>
<Outlet />
</div>