From bea8cc2bb997c90000df4e9554145e475b5afe0a Mon Sep 17 00:00:00 2001 From: andres Date: Sun, 21 Apr 2024 00:51:26 +0200 Subject: [PATCH] feat: add podcast episodes list styles --- src/components/podcast-episodes-list.tsx | 63 ++++++++++++++++-------- src/components/podcast-info-card.tsx | 2 +- 2 files changed, 43 insertions(+), 22 deletions(-) diff --git a/src/components/podcast-episodes-list.tsx b/src/components/podcast-episodes-list.tsx index 469f0b8..a8a4667 100644 --- a/src/components/podcast-episodes-list.tsx +++ b/src/components/podcast-episodes-list.tsx @@ -1,5 +1,13 @@ import { Link, useParams } from "react-router-dom"; import { usePodcastQuery } from "../services/podcasts/podcast.hooks"; +import { + Table, + TableBody, + TableCell, + TableHead, + TableHeadCell, + TableRow, +} from "./ui/table/table"; export function PodcastEpisodesList() { const { podcastId } = useParams<{ podcastId: string }>(); @@ -7,34 +15,43 @@ export function PodcastEpisodesList() { return (
-
Episodes: {podcast?.trackCount}
-
- - - - - - - - - +
+ Episodes: {podcast?.trackCount} +
+
+
TitleRelease DateDuration
+ + + Title + Date + Duration + + + {podcast?.episodes?.map((episode) => { const formattedDate = formatDate(episode.releaseDate); const formattedDuration = formatDuration(episode.durationSeconds); const url = `/podcast/${podcastId}/episode/${episode.id}`; return ( - - - - - + + + + {episode.title} + + + {formattedDate} + + {formattedDuration} + + ); })} - -
- {episode.title} - {formattedDate}{formattedDuration}
+ +
); @@ -50,5 +67,9 @@ function formatDuration(duration?: number) { } function formatDate(date: string) { - return new Date(date).toLocaleDateString(); + return new Date(date).toLocaleDateString("es-ES", { + month: "2-digit", + day: "2-digit", + year: "numeric", + }); } diff --git a/src/components/podcast-info-card.tsx b/src/components/podcast-info-card.tsx index cb1489a..9582f44 100644 --- a/src/components/podcast-info-card.tsx +++ b/src/components/podcast-info-card.tsx @@ -23,7 +23,7 @@ export function PodcastInfoCard({ const shouldWrapWithLink = !!episodeId; return ( -