feat: enhance home and library pages by integrating new data fetching methods, improving error handling, and refactoring components for better structure
All checks were successful
Deploy with Docker Compose / deploy (push) Successful in 4m17s
All checks were successful
Deploy with Docker Compose / deploy (push) Successful in 4m17s
This commit is contained in:
48
src/app/series/[seriesId]/SeriesContent.tsx
Normal file
48
src/app/series/[seriesId]/SeriesContent.tsx
Normal file
@@ -0,0 +1,48 @@
|
||||
"use client";
|
||||
|
||||
import { PaginatedBookGrid } from "@/components/series/PaginatedBookGrid";
|
||||
import { SeriesHeader } from "@/components/series/SeriesHeader";
|
||||
import { Container } from "@/components/ui/container";
|
||||
import { useRefresh } from "@/contexts/RefreshContext";
|
||||
import type { LibraryResponse } from "@/types/library";
|
||||
import type { KomgaBook, KomgaSeries } from "@/types/komga";
|
||||
import type { UserPreferences } from "@/types/preferences";
|
||||
|
||||
interface SeriesContentProps {
|
||||
series: KomgaSeries;
|
||||
books: LibraryResponse<KomgaBook>;
|
||||
currentPage: number;
|
||||
preferences: UserPreferences;
|
||||
unreadOnly: boolean;
|
||||
pageSize: number;
|
||||
}
|
||||
|
||||
export function SeriesContent({
|
||||
series,
|
||||
books,
|
||||
currentPage,
|
||||
preferences,
|
||||
unreadOnly,
|
||||
}: SeriesContentProps) {
|
||||
const { refreshSeries } = useRefresh();
|
||||
|
||||
return (
|
||||
<>
|
||||
<SeriesHeader
|
||||
series={series}
|
||||
refreshSeries={refreshSeries || (async () => ({ success: false }))}
|
||||
/>
|
||||
<Container>
|
||||
<PaginatedBookGrid
|
||||
books={books.content || []}
|
||||
currentPage={currentPage}
|
||||
totalPages={books.totalPages}
|
||||
totalElements={books.totalElements}
|
||||
defaultShowOnlyUnread={preferences.showOnlyUnread}
|
||||
showOnlyUnread={unreadOnly}
|
||||
/>
|
||||
</Container>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user