mirror of
https://github.com/ershisan99/podcaster.git
synced 2026-01-03 21:02:07 +00:00
feat: add podcasts service
This commit is contained in:
@@ -1,30 +1,22 @@
|
||||
import { PodcastPreviewCard } from "../components/podcast-preview-card";
|
||||
import { podcastsService } from "../services/podcasts/podcasts.service";
|
||||
import { useQuery } from "../hooks/useQuery";
|
||||
|
||||
export function Home() {
|
||||
const { data } = useQuery(() => podcastsService.getTopPodcasts());
|
||||
|
||||
return (
|
||||
<main>
|
||||
<div className={"grid grid-cols-4"}>
|
||||
{podcasts.map((podcast) => (
|
||||
{data?.map((podcast) => (
|
||||
<PodcastPreviewCard
|
||||
key={podcast.id}
|
||||
title={podcast.title}
|
||||
author={podcast.author}
|
||||
imageUrl={podcast.imageSrc}
|
||||
imageUrl={podcast.imageUrl}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
|
||||
const podcasts = [
|
||||
{
|
||||
imageSrc: "https://picsum.photos/200/200",
|
||||
title: "Podcast 1",
|
||||
author: "Author 1",
|
||||
},
|
||||
{
|
||||
imageSrc: "https://picsum.photos/200/200",
|
||||
title: "Podcast 2",
|
||||
author: "Author 2",
|
||||
},
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user