"use client";
import { useState } from "react";
import Image from "next/image";
import { useTranslation } from "../../lib/i18n/context";
const PAGE_SIZE = 5;
export function BookPreview({ bookId, pageCount }: { bookId: string; pageCount: number }) {
const { t } = useTranslation();
const [offset, setOffset] = useState(0);
const pages = Array.from({ length: PAGE_SIZE }, (_, i) => offset + i + 1).filter(
(p) => p <= pageCount
);
return (
{t("bookPreview.preview")}
{t("bookPreview.pages", { start: offset + 1, end: Math.min(offset + PAGE_SIZE, pageCount), total: pageCount })}
{pages.map((pageNum) => (
))}
);
}