feat: add navigation to book reader from series page - Add book click handler in PaginatedBookGrid - Simplify BookGrid component with direct navigation - Keep book status and metadata display - Ensure consistent navigation behavior across the app
This commit is contained in:
@@ -15,7 +15,6 @@ interface PaginatedBookGridProps {
|
||||
totalPages: number;
|
||||
totalElements: number;
|
||||
pageSize: number;
|
||||
onBookClick?: (book: KomgaBook) => void;
|
||||
}
|
||||
|
||||
export function PaginatedBookGrid({
|
||||
@@ -25,7 +24,6 @@ export function PaginatedBookGrid({
|
||||
totalPages,
|
||||
totalElements,
|
||||
pageSize,
|
||||
onBookClick,
|
||||
}: PaginatedBookGridProps) {
|
||||
const router = useRouter();
|
||||
const pathname = usePathname();
|
||||
@@ -66,6 +64,14 @@ export function PaginatedBookGrid({
|
||||
router.push(`${pathname}?${params.toString()}`);
|
||||
};
|
||||
|
||||
const handleBookClick = (book: KomgaBook) => {
|
||||
console.log("PaginatedBookGrid - handleBookClick:", {
|
||||
bookId: book.id,
|
||||
bookTitle: book.metadata.title,
|
||||
});
|
||||
router.push(`/books/${book.id}`);
|
||||
};
|
||||
|
||||
// Calcul des indices de début et de fin pour l'affichage
|
||||
const startIndex = (currentPage - 1) * pageSize + 1;
|
||||
const endIndex = Math.min(currentPage * pageSize, totalElements);
|
||||
@@ -117,7 +123,7 @@ export function PaginatedBookGrid({
|
||||
>
|
||||
<BookGrid
|
||||
books={books}
|
||||
onBookClick={onBookClick}
|
||||
onBookClick={handleBookClick}
|
||||
getBookThumbnailUrl={getBookThumbnailUrl}
|
||||
/>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user