feat: adding a carou for books on going
This commit is contained in:
@@ -2,10 +2,11 @@ import { HeroSection } from "./HeroSection";
|
||||
import { MediaRow } from "./MediaRow";
|
||||
import { KomgaBook, KomgaSeries } from "@/types/komga";
|
||||
import { RefreshButton } from "@/components/library/RefreshButton";
|
||||
import { BookOpenCheck, History, Sparkles, Clock } from "lucide-react";
|
||||
import { BookOpenCheck, History, Sparkles, Clock, LibraryBig, BookOpen } from "lucide-react";
|
||||
|
||||
interface HomeData {
|
||||
ongoing: KomgaSeries[];
|
||||
ongoingBooks: KomgaBook[];
|
||||
recentlyRead: KomgaBook[];
|
||||
onDeck: KomgaBook[];
|
||||
latestSeries: KomgaSeries[];
|
||||
@@ -49,7 +50,7 @@ export function HomeContent({ data, refreshHome }: HomeContentProps) {
|
||||
title: metadata.title,
|
||||
number: metadata.number,
|
||||
},
|
||||
readProgress,
|
||||
readProgress: readProgress || { page: 0 },
|
||||
media
|
||||
}));
|
||||
};
|
||||
@@ -69,9 +70,17 @@ export function HomeContent({ data, refreshHome }: HomeContentProps) {
|
||||
<div className="space-y-12">
|
||||
{data.ongoing && data.ongoing.length > 0 && (
|
||||
<MediaRow
|
||||
title="Continuer la lecture"
|
||||
title="Continuer la série"
|
||||
items={optimizeSeriesData(data.ongoing)}
|
||||
icon={<BookOpenCheck className="w-6 h-6" />}
|
||||
icon={<LibraryBig className="w-6 h-6" />}
|
||||
/>
|
||||
)}
|
||||
|
||||
{data.ongoingBooks && data.ongoingBooks.length > 0 && (
|
||||
<MediaRow
|
||||
title="Continuer la lecture"
|
||||
items={optimizeBookData(data.ongoingBooks)}
|
||||
icon={<BookOpen className="w-6 h-6" />}
|
||||
/>
|
||||
)}
|
||||
|
||||
|
||||
@@ -18,6 +18,12 @@ interface OptimizedSeries extends BaseItem {
|
||||
}
|
||||
|
||||
interface OptimizedBook extends BaseItem {
|
||||
readProgress:{
|
||||
page: number
|
||||
}
|
||||
media: {
|
||||
pagesCount: number;
|
||||
}
|
||||
metadata: {
|
||||
title: string;
|
||||
number?: string;
|
||||
@@ -128,6 +134,8 @@ function MediaCard({ item, onClick }: MediaCardProps) {
|
||||
readBooks={isSeries ? item.booksReadCount : undefined}
|
||||
totalBooks={isSeries ? item.booksCount : undefined}
|
||||
isCompleted={isSeries ? item.booksCount === item.booksReadCount : undefined}
|
||||
currentPage={isSeries ? undefined : item.readProgress?.page}
|
||||
totalPages={isSeries ? undefined : item.media?.pagesCount}
|
||||
/>
|
||||
{/* Overlay avec les informations au survol */}
|
||||
<div className="absolute inset-0 bg-black/60 opacity-0 hover:opacity-100 transition-opacity duration-200 flex flex-col justify-end p-3">
|
||||
|
||||
Reference in New Issue
Block a user