diff --git a/src/components/overlays/details/DetailsContent.tsx b/src/components/overlays/details/DetailsContent.tsx index 1fe1d48d..0d810b61 100644 --- a/src/components/overlays/details/DetailsContent.tsx +++ b/src/components/overlays/details/DetailsContent.tsx @@ -79,7 +79,19 @@ export function DetailsContent({ data, minimal = false }: DetailsContentProps) { undefined, formattedLanguage, ); - setImdbData(imdbMetadata); + // Transform the data to match the expected format + if ( + typeof imdbMetadata.imdb_rating === "number" && + typeof imdbMetadata.votes === "number" + ) { + setImdbData({ + rating: imdbMetadata.imdb_rating, + votes: imdbMetadata.votes, + trailer_url: imdbMetadata.trailer_url || null, + }); + } else { + setImdbData(null); + } // Fetch Rotten Tomatoes data if (data.type === "movie") { @@ -176,15 +188,16 @@ export function DetailsContent({ data, minimal = false }: DetailsContentProps) { )}
@@ -204,6 +217,7 @@ export function DetailsContent({ data, minimal = false }: DetailsContentProps) { seasons={ data.type === "show" ? data.seasonData?.seasons.length : undefined } + imdbData={imdbData} /> {/* Two Column Layout - Stacked on Mobile */} diff --git a/src/components/overlays/details/DetailsHeader.tsx b/src/components/overlays/details/DetailsHeader.tsx index 222b91e2..0ff70938 100644 --- a/src/components/overlays/details/DetailsHeader.tsx +++ b/src/components/overlays/details/DetailsHeader.tsx @@ -18,6 +18,7 @@ export function DetailsHeader({ voteCount, releaseDate, seasons, + imdbData, }: DetailsHeaderProps) { const formatDate = (dateString?: string) => { if (!dateString) return null; @@ -30,7 +31,7 @@ export function DetailsHeader({
{voteAverage && (
- + {voteAverage.toFixed(1)} {voteCount && ( @@ -39,6 +40,20 @@ export function DetailsHeader({ )}
)} + {imdbData?.rating && ( + <> + +
+ + {imdbData.rating.toFixed(1)} + {imdbData.votes && ( + + ({imdbData.votes.toLocaleString()}) + + )} +
+ + )} {releaseDate && ( <> diff --git a/src/components/overlays/details/DetailsModal.tsx b/src/components/overlays/details/DetailsModal.tsx index 53edde6b..4e6b637b 100644 --- a/src/components/overlays/details/DetailsModal.tsx +++ b/src/components/overlays/details/DetailsModal.tsx @@ -117,7 +117,7 @@ export function DetailsModal({ id, data, minimal }: DetailsModalProps) { darken close={modal.hide} show={modal.isShown} - durationClass="duration-400" + durationClass="duration-500" > diff --git a/src/components/overlays/details/DetailsSkeleton.tsx b/src/components/overlays/details/DetailsSkeleton.tsx index 99645296..23d07b26 100644 --- a/src/components/overlays/details/DetailsSkeleton.tsx +++ b/src/components/overlays/details/DetailsSkeleton.tsx @@ -1,41 +1,128 @@ export function DetailsSkeleton() { + // Static arrays of unique identifiers for skeleton elements + const episodeSkeletons = [ + "episode-skeleton-1", + "episode-skeleton-2", + "episode-skeleton-3", + "episode-skeleton-4", + ]; + const castSkeletons = [ + "cast-skeleton-1", + "cast-skeleton-2", + "cast-skeleton-3", + "cast-skeleton-4", + "cast-skeleton-5", + "cast-skeleton-6", + ]; + return ( -
-
- {/* Backdrop */} -
-
+
+ {/* Backdrop */} +
+ {/* Title/Logo positioned on backdrop */} +
+
{" "} + {/* Logo/Title placeholder */}
- {/* Content */} -
-
{/* Title */} -
+
+
+ + {/* Content */} +
+ {/* Header */} +
+
{" "} + {/* Play button */} +
{" "} + {/* Trailer button */} +
{" "} + {/* Share button */} +
+
{/* Rating */} +
{" "} + {/* Release date */} +
+ + {/* Two Column Layout */} +
+ {/* Left Column - Main Content (2/3) */} +
{/* Description */} -
-
-
-
+
+
+
+
+
+ + {/* Genres */} +
+
+
+
+
+ + {/* Director and Cast */} +
+
{/* Director */} +
{/* Cast */} +
- {/* Additional details */} -
-
-
-
-
+ + {/* Right Column - Details Info (1/3) */} +
+
+
+
{/* Runtime */} +
{" "} + {/* Language */} +
{" "} + {/* Release date */} +
{/* Rating */} +
{" "} + {/* External ratings */} +
+
- {/* Genres */} -
-
-
-
+
+ + {/* Episodes Carousel Skeleton */} +
+
{" "} + {/* Season selector */} +
+ {episodeSkeletons.map((key) => ( +
+ ))} +
+
+ + {/* Cast Carousel Skeleton */} +
+
{" "} + {/* Cast title */} +
+ {castSkeletons.map((key) => ( +
+
{" "} + {/* Profile image */} +
{" "} + {/* Name */} +
+ ))}
diff --git a/src/components/overlays/details/types.ts b/src/components/overlays/details/types.ts index 07765486..ae474d17 100644 --- a/src/components/overlays/details/types.ts +++ b/src/components/overlays/details/types.ts @@ -109,6 +109,10 @@ export interface DetailsHeaderProps { voteCount?: number; releaseDate?: string; seasons?: number; + imdbData?: { + rating: number; + votes: number; + }; } export interface DetailsInfoProps {