import Link from "next/link";
import { AppBrand, ArrowLeftIcon } from "@/components/AppBrand";
import { Proofreader } from "@/components/proofreader/Proofreader";

export const metadata = { title: "校对与整理 · 听阅" };

export default async function EditBookPage({
  params,
}: {
  params: Promise<{ bookId: string }>;
}) {
  const { bookId } = await params;
  return (
    <div className="proofreader-shell">
      <header className="workflow-topbar">
        <AppBrand />
        <Link className="back-link" href="/"><ArrowLeftIcon />返回书架</Link>
      </header>
      <main className="proofreader-main">
        <div className="proofreader-heading">
          <div>
            <p className="eyebrow">校对与整理</p>
            <h1>让正文听起来顺畅</h1>
            <p>公式和表格默认跳过；发现错误时，只修改受影响的段落并重新生成语音。</p>
          </div>
          <Link className="button button-primary" href={`/books/${bookId}/listen`}>立即收听</Link>
        </div>
        <Proofreader bookId={bookId} />
      </main>
    </div>
  );
}
