"use client" import { use } from "react" import { notFound } from "next/navigation" import { BookOpen, Eye, BookMarked, User, Clock, Layers } from "lucide-react" import { getNovelBySlug, getChaptersByNovelId, getCommentsByNovelId, genres, formatViews } from "@/lib/data" import { GenreBadge } from "@/components/genre-badge" import { StarRating } from "@/components/star-rating" import { ChapterList } from "@/components/chapter-list" import { CommentSection } from "@/components/comment-section" import { NovelDetailActions } from "./novel-detail-actions" export default function NovelDetailPage({ params }: { params: Promise<{ slug: string }> }) { const { slug } = use(params) const novel = getNovelBySlug(slug) if (!novel) { notFound() } const chapters = getChaptersByNovelId(novel.id) const comments = getCommentsByNovelId(novel.id) const novelGenres = novel.genres .map((gSlug) => genres.find((g) => g.slug === gSlug)) .filter(Boolean) as typeof genres return (
{/* Novel Header */}
{/* Cover */}
{/* Info */}

{novel.title}

{novel.author} {novel.totalChapters} chương {formatViews(novel.views)} lượt xem {formatViews(novel.bookmarkCount)} bookmark Cập nhật: {novel.lastUpdated}
{novel.status}
{novelGenres.map((g) => ( ))}
{/* Description */}

Giới Thiệu

{novel.description}

{/* Chapter list */}

Danh Sách Chương

{/* Comments */}
) }