"use client"; import { createReactBlockSpec } from "@blocknote/react"; import { RiFileTextFill } from "react-icons/ri"; import { useRouter } from "next/navigation"; const normalizeTitle = (value?: string | null) => { if (!value || !value.trim()) { return "未命名页面"; } return value; }; const PageReferenceContent = ({ pageId, title, asChildPage, }: { pageId: string; title: string; asChildPage: boolean; }) => { const router = useRouter(); // 说明:Convex 迁移阶段,直接使用 block props 里的 title,不做实时订阅/拉取。 // 页面引用的标题会由编辑器同步更新 block.props.title。 const resolvedTitle = normalizeTitle(title); const navigate = () => { if (pageId) { router.push(`/documents/${pageId}`); } }; return (