import { readFileSync } from "fs";
import path from "path";
import { parseEbookMarkdown } from "../../lib/ebook";
import EbookClient from "./EbookClient";

export const metadata = {
  title: "电子书 | 数字游民",
  description: "数字游民：地理套利与自动化杠杆，低成本工作室、云手机、无人直播、出海掘金。",
};

export default function EbookPage() {
  const mdPath = path.join(process.cwd(), "app/data/ebook.md");
  const source = readFileSync(mdPath, "utf-8");
  const data = parseEbookMarkdown(source);

  return <EbookClient data={data} />;
}
