@@ -8,18 +8,16 @@ interface PodcastData {
88 id : string ;
99 spotifyUrl : string ;
1010 type : "episode" | "show" | "playlist" ;
11- title ?: string ; // Add optional title here
11+ title ?: string ;
1212}
1313
14- // Function to extract Spotify ID from URL
1514const getSpotifyEmbedId = ( url : string ) : string => {
1615 const match = url . match (
1716 / (?: s p o t i f y \. c o m | o p e n \. s p o t i f y \. c o m ) \/ ( e p i s o d e | s h o w | p l a y l i s t ) \/ ( [ a - z A - Z 0 - 9 ] + ) / ,
1817 ) ;
1918 return match ? match [ 2 ] : url ;
2019} ;
2120
22- // Function to determine content type from URL
2321const getSpotifyContentType = (
2422 url : string ,
2523) : "episode" | "show" | "playlist" => {
@@ -29,7 +27,6 @@ const getSpotifyContentType = (
2927 return ( match ?. [ 1 ] as "episode" | "show" | "playlist" ) || "show" ;
3028} ;
3129
32- // Add your podcasts here
3330const podcastUrls : string [ ] = [
3431 "https://open.spotify.com/show/6oPJ7ZBlN7y34yiSMguIda?si=729edf3b64a246d7" ,
3532 "https://open.spotify.com/episode/1zbmUPmGRjC8o8YIMMx2Z6?si=Q4QAS3IJQVGaQYhYApckdA" ,
@@ -48,14 +45,12 @@ const podcastUrls: string[] = [
4845 "https://open.spotify.com/show/1hRuJ14RwtnPtElAxnTEcO?si=7900bc46e9424eef" ,
4946] ;
5047
51- // Initialize podcast data without titles first
5248const initialPodcastData : PodcastData [ ] = podcastUrls . map ( ( url , index ) => ( {
5349 id : String ( index + 1 ) ,
5450 spotifyUrl : url ,
5551 type : getSpotifyContentType ( url ) ,
5652} ) ) ;
5753
58- // Component to display Spotify title and type badge for each podcast
5954const SpotifyTitle : React . FC < {
6055 title ?: string ;
6156 type : "episode" | "show" | "playlist" ;
@@ -88,7 +83,6 @@ export default function Podcasts(): ReactElement {
8883 const [ podcasts , setPodcasts ] = useState < PodcastData [ ] > ( initialPodcastData ) ;
8984 const podcastsPerPage = 9 ;
9085
91- // Fetch all podcast titles once on mount
9286 useEffect ( ( ) => {
9387 let cancelled = false ;
9488 Promise . all (
@@ -102,7 +96,6 @@ export default function Podcasts(): ReactElement {
10296 ) ,
10397 ) . then ( ( results ) => {
10498 if ( ! cancelled ) {
105- // Merge fetched titles into podcasts state
10699 setPodcasts ( ( prev ) =>
107100 prev . map ( ( p ) => {
108101 const found = results . find ( ( r ) => r . id === p . id ) ;
@@ -116,7 +109,6 @@ export default function Podcasts(): ReactElement {
116109 } ;
117110 } , [ ] ) ;
118111
119- // Filter podcasts based on search and filter using title now
120112 const filteredPodcasts = podcasts . filter ( ( podcast ) => {
121113 const matchesFilter =
122114 selectedFilter === "all" || podcast . type === selectedFilter ;
@@ -127,7 +119,6 @@ export default function Podcasts(): ReactElement {
127119 return matchesFilter && matchesSearch ;
128120 } ) ;
129121
130- // Pagination calculations
131122 const indexOfLastPodcast = currentPage * podcastsPerPage ;
132123 const indexOfFirstPodcast = indexOfLastPodcast - podcastsPerPage ;
133124 const currentPodcasts = filteredPodcasts . slice (
@@ -195,7 +186,6 @@ export default function Podcasts(): ReactElement {
195186 return (
196187 < Layout >
197188 < div className = "enhanced-podcast-container" >
198- { /* Hero Section */ }
199189 < div className = "podcast-hero" >
200190 < div className = "podcast-hero-content" >
201191 < div className = "hero-badge" >
@@ -225,7 +215,6 @@ export default function Podcasts(): ReactElement {
225215 </ div >
226216 </ div >
227217
228- { /* Filter Section */ }
229218 < div className = "podcast-filters" >
230219 < div className = "filter-search" >
231220 < div className = "search-icon" > </ div >
@@ -269,7 +258,6 @@ export default function Podcasts(): ReactElement {
269258 </ div >
270259 </ div >
271260
272- { /* Content Grid */ }
273261 < div className = "podcast-content-section" >
274262 { currentPodcasts . length > 0 ? (
275263 < >
@@ -347,17 +335,11 @@ export default function Podcasts(): ReactElement {
347335 />
348336 </ div >
349337
350- < div className = "podcast-card-footer" >
351- < button className = "listen-button" >
352- < span className = "listen-icon" > ▶️</ span >
353- Listen Now
354- </ button >
355- </ div >
338+ { /* Removed podcast-card-footer section */ }
356339 </ div >
357340 ) ) }
358341 </ div >
359342
360- { /* Enhanced Pagination */ }
361343 { totalPages > 1 && (
362344 < div className = "enhanced-pagination" >
363345 < button
0 commit comments