0.1.13 AI功能大改
This commit is contained in:
@@ -20,15 +20,20 @@ export function Breadcrumb({ documents }: BreadcrumbProps) {
|
||||
const showInspector = usePageLayoutStore((state) => state.showInspector);
|
||||
const toggleInspector = usePageLayoutStore((state) => state.toggleInspector);
|
||||
|
||||
if (!path.length) {
|
||||
// 新建页面后,侧边栏数据可能还没同步到 layout(SSR)注入的 documents,导致 findBreadcrumb 暂时为空。
|
||||
// 这里用 activeId 兜底,避免右上角“收藏/更多”按钮消失。
|
||||
if (!activeId) {
|
||||
return <div className="text-sm text-gray-400">请选择一个页面</div>;
|
||||
}
|
||||
const displayPath: Array<Pick<DocumentRecord, "id" | "title">> = path.length
|
||||
? path
|
||||
: [{ id: activeId, title: "无标题" }];
|
||||
|
||||
return (
|
||||
<div className="flex flex-1 items-center justify-between">
|
||||
<nav className="flex items-center text-sm text-gray-500">
|
||||
{path.map((node, index) => {
|
||||
const isLast = index === path.length - 1;
|
||||
{displayPath.map((node, index) => {
|
||||
const isLast = index === displayPath.length - 1;
|
||||
return (
|
||||
<span key={node.id} className="flex items-center">
|
||||
{index > 0 && <ChevronRight className="mx-1 h-4 w-4 text-gray-400" />}
|
||||
|
||||
Reference in New Issue
Block a user