/** * Component: Series Card * Documentation: documentation/frontend/components.md * * Premium "Cover First" design - metadata integrated into the cover overlay. * Rating badge top-left, book count top-right, tags in bottom gradient overlay. * Only the title lives below the cover, ensuring consistent row heights in the grid. */ 'use client'; import React from 'react'; import Image from 'next/image'; import Link from 'next/link'; import { SeriesSummary } from '@/lib/hooks/useSeries'; interface SeriesCardProps { series: SeriesSummary; squareCovers?: boolean; } export function SeriesCard({ series, squareCovers = false }: SeriesCardProps) { const visibleTags = series.tags.slice(0, 2); const hasTags = visibleTags.length > 0; const hasRating = series.rating != null && series.rating > 0; return ( {/* Cover Container — The Hero */}
{/* Cover Art or Fallback */} {series.coverArtUrl ? ( ) : (
)} {/* Top-row badges — Rating (left) + Book count (right) */} {/* Rating Badge — top-left, matches AudiobookCard pattern exactly */} {hasRating && (
{series.rating!.toFixed(1)}
)} {/* Book count badge — top-right */} {series.bookCount > 0 && (
{series.bookCount} {series.bookCount === 1 ? 'Book' : 'Books'}
)} {/* Bottom gradient overlay — always present, deepens on hover */}
{/* Tag pills — pinned to bottom of cover, inside gradient */} {hasTags && (
{visibleTags.map(tag => ( {tag} ))}
)}
{/* Below-cover: title only — fixed, predictable height across all cards */}

{series.title}

); }