Files
stripstream/src/app/books/[bookId]/page.tsx
2025-02-14 13:08:05 +01:00

21 lines
662 B
TypeScript

import { Suspense } from "react";
import { ClientBookWrapper } from "@/components/reader/ClientBookWrapper";
import { BookSkeleton } from "@/components/skeletons/BookSkeleton";
import { BookService } from "@/lib/services/book.service";
import { notFound } from "next/navigation";
export default async function BookPage({ params }: { params: { bookId: string } }) {
try {
const data = await BookService.getBook(params.bookId);
return (
<Suspense fallback={<BookSkeleton />}>
<ClientBookWrapper book={data.book} pages={data.pages} />
</Suspense>
);
} catch (error) {
console.error("Erreur:", error);
notFound();
}
}