@@ -63,11 +62,7 @@ export function BookGrid({ books, onBookClick, getBookThumbnailUrl }: BookGridPr
onClick={() => onBookClick(book)}
className="group relative aspect-[2/3] overflow-hidden rounded-lg bg-muted hover:opacity-100 transition-all"
>
-
{book.metadata.title || `Tome ${book.metadata.number}`}
@@ -87,11 +82,10 @@ export function BookGrid({ books, onBookClick, getBookThumbnailUrl }: BookGridPr
interface BookImageProps {
book: KomgaBook;
- getBookThumbnailUrl: (bookId: string) => string;
isCompleted?: boolean;
}
-function BookImage({ book, getBookThumbnailUrl, isCompleted }: BookImageProps) {
+function BookImage({ book, isCompleted }: BookImageProps) {
const [imageError, setImageError] = useState(false);
const [isLoading, setIsLoading] = useState(true);
@@ -104,23 +98,27 @@ function BookImage({ book, getBookThumbnailUrl, isCompleted }: BookImageProps) {
}
return (
-
+ <>
setImageError(true)}
onLoad={() => setIsLoading(false)}
loading="lazy"
- quality={100}
+ quality={80}
+ unoptimized
+ priority={false}
+ fetchPriority="low"
/>
-
+ >
);
}
diff --git a/src/components/series/SeriesHeader.tsx b/src/components/series/SeriesHeader.tsx
index 612d973..1348480 100644
--- a/src/components/series/SeriesHeader.tsx
+++ b/src/components/series/SeriesHeader.tsx
@@ -52,13 +52,10 @@ export const SeriesHeader = ({ series, onSeriesUpdate }: SeriesHeaderProps) => {
const { toast } = useToast();
const [languageDisplay, setLanguageDisplay] = useState
(series.metadata.language);
const [imageError, setImageError] = useState(false);
- const [readingStatus, setReadingStatus] = useState(
- getReadingStatusInfo(series)
- );
+ const [isLoading, setIsLoading] = useState(true);
const [isFavorite, setIsFavorite] = useState(false);
- const [isLoading, setIsLoading] = useState(false);
const [mounted, setMounted] = useState(false);
- const [imageLoading, setImageLoading] = useState(true);
+ const statusInfo = getReadingStatusInfo(series);
// Vérifier si la série est dans les favoris au chargement
useEffect(() => {
@@ -78,10 +75,6 @@ export const SeriesHeader = ({ series, onSeriesUpdate }: SeriesHeaderProps) => {
setMounted(true);
}, [series.id]);
- useEffect(() => {
- setReadingStatus(getReadingStatusInfo(series));
- }, [series]);
-
useEffect(() => {
try {
if (series.metadata.language) {
@@ -133,138 +126,90 @@ export const SeriesHeader = ({ series, onSeriesUpdate }: SeriesHeaderProps) => {
}
};
- const StatusIcon = readingStatus.icon;
-
return (
-
- {/* Fond flou */}
-
- {!imageError && (
-
- setImageLoading(false)}
- />
-
- )}
-
+
+ {/* Image de fond */}
+ {!imageError ? (
+ <>
+
+
setImageError(true)}
+ onLoad={() => setIsLoading(false)}
+ quality={60}
+ priority
+ unoptimized
+ />
+ >
+ ) : (
+
+
+
+ )}
{/* Contenu */}
-
-
- {/* Image de couverture */}
-
+
+
+ {/* Image principale */}
+
{!imageError ? (
-
-
+ <>
+
setImageError(true)}
- onLoad={() => setImageLoading(false)}
- loading="lazy"
- quality={100}
+ onLoad={() => setIsLoading(false)}
+ quality={90}
+ priority
+ unoptimized
/>
-
+ >
) : (
-
{/* Informations */}
-
-
-
{series.name}
- {mounted && (
-
- )}
-
-
- {/* Métadonnées */}
-
- {series.metadata.publisher && (
- {series.metadata.publisher}
- )}
- {languageDisplay && (
- {languageDisplay}
- )}
- {series.metadata.status && (
-
- {series.metadata.status.toLowerCase()}
-
- )}
-
-
- {/* Stats */}
-
-
-
- {readingStatus.label}
-
-
- {series.booksCount} tomes
- {series.booksReadCount} lus
- {series.booksInProgressCount} en cours
-
-
-
- {/* Description */}
+
+
{series.metadata.title}
{series.metadata.summary && (
-
- {series.metadata.summary}
-
- )}
-
- {/* Tags et genres */}
- {(series.metadata.tags?.length > 0 || series.metadata.genres?.length > 0) && (
-
- {[...(series.metadata.genres || []), ...(series.metadata.tags || [])].map((tag) => (
-
- {tag}
-
- ))}
-
+
{series.metadata.summary}
)}
+
+
+
+ {statusInfo.label}
+
+
+ {series.booksCount} tome{series.booksCount > 1 ? "s" : ""}
+
+
+