"use client"; import { Library, BookOpen } from "lucide-react"; import type { KomgaLibrary, KomgaSeries } from "@/types/komga"; import { RefreshButton } from "./RefreshButton"; import { useTranslate } from "@/hooks/useTranslate"; import { StatusBadge } from "@/components/ui/status-badge"; import { SeriesCover } from "@/components/ui/series-cover"; interface LibraryHeaderProps { library: KomgaLibrary; seriesCount: number; series: KomgaSeries[]; refreshLibrary: (libraryId: string) => Promise<{ success: boolean; error?: string }>; } export const LibraryHeader = ({ library, seriesCount, series, refreshLibrary }: LibraryHeaderProps) => { const { t } = useTranslate(); // Sélectionner une série aléatoire pour l'image centrale const randomSeries = series.length > 0 ? series[Math.floor(Math.random() * series.length)] : null; // Sélectionner une autre série aléatoire pour le fond (différente de celle du centre) const backgroundSeries = series.length > 1 ? series.filter(s => s.id !== randomSeries?.id)[Math.floor(Math.random() * (series.length - 1))] : randomSeries; return (
{t("library.header.unavailable")}
)}