'use client'; import React, {useState} from "react"; import {FontAwesomeIcon} from "@fortawesome/react-fontawesome"; import {faCog, faLayerGroup} from "@fortawesome/free-solid-svg-icons"; import {BookProps} from "@/lib/models/Book"; import BookCard from "@/components/book/BookCard"; import {useTranslations} from "next-intl"; import {SyncType} from "@/context/BooksSyncContext"; import {SeriesSyncType} from "@/context/SeriesSyncContext"; import SyncSeries from "@/components/SyncSeries"; export interface SeriesCardProps { id: string; name: string; coverImage: string | null; books: BookProps[]; } interface SeriesCardComponentProps { series: SeriesCardProps; onBookClick: (bookId: string) => Promise; onSettingsClick: (seriesId: string) => void; getSyncStatus?: (bookId: string) => SyncType; seriesSyncStatus?: SeriesSyncType; } export default function SeriesCard({series, onBookClick, onSettingsClick, getSyncStatus, seriesSyncStatus = 'synced'}: SeriesCardComponentProps) { const t = useTranslations(); const [isExpanded, setIsExpanded] = useState(false); return (
setIsExpanded(!isExpanded)} className={`group bg-tertiary/90 backdrop-blur-sm shadow-lg hover:shadow-2xl transition-all duration-300 border-2 border-primary/50 hover:border-primary flex flex-col cursor-pointer flex-shrink-0 w-64 sm:w-52 md:w-48 lg:w-56 xl:w-64 ${isExpanded ? 'rounded-l-2xl border-r-0' : 'rounded-2xl'}`} >
{series.coverImage ? ( {series.name} ) : (
)}
{series.books.length}

{series.name}

{series.books.length} {series.books.length > 1 ? t("seriesCard.books") : t("seriesCard.book")}

{t("seriesCard.series")}
{series.books.map((book: BookProps, idx: number) => (
))} {/* Bouton Settings */}
{/* Bordure de fin */}
); }