This commit is contained in:
2026-02-26 11:07:10 +08:00
parent 85edf0d847
commit eb68553baf
9 changed files with 329 additions and 168 deletions
+35 -24
View File
@@ -293,53 +293,63 @@ export default function Home() {
editable={!activePage.isLocked}
/>
<section className="ui-enter mt-6 space-y-3 md:mt-8 md:space-y-4">
<div className="ui-card p-3 md:p-4">
<h3 className="text-sm font-semibold text-foreground"></h3>
<p className="mt-1 text-xs text-muted-foreground">使 `[[页面名]]` `Ctrl/Cmd + 点击` </p>
<div className="mt-3 flex flex-wrap gap-2">
<section className="ui-enter mt-6 space-y-3 md:mt-7">
<div className="grid gap-2 md:grid-cols-3">
<div className="ui-card p-2.5 md:p-3">
<div className="flex items-center justify-between">
<h3 className="text-sm font-semibold text-foreground"></h3>
<span className="rounded bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground">{outgoingLinks.length}</span>
</div>
<p className="mt-1 text-[11px] text-muted-foreground"> `[[页面名]]` </p>
<div className="mt-2 flex flex-wrap gap-1.5">
{outgoingLinks.length > 0 ? (
outgoingLinks.map((item) => (
<button
key={item.id}
onClick={() => setActivePageId(item.id)}
className="rounded-md border border-border/70 bg-muted/40 px-2.5 py-1 text-xs text-foreground transition-colors hover:bg-accent"
className="rounded-md border border-border/70 bg-muted/40 px-2 py-0.5 text-[11px] text-foreground transition-colors hover:bg-accent"
>
{item.icon ? `${item.icon} ` : ""}
{item.title}
</button>
))
) : (
<span className="text-xs text-muted-foreground"></span>
<span className="text-[11px] text-muted-foreground"></span>
)}
</div>
</div>
</div>
<div className="ui-card p-3 md:p-4">
<h3 className="text-sm font-semibold text-foreground"></h3>
<p className="mt-1 text-xs text-muted-foreground"></p>
<div className="mt-3 flex flex-wrap gap-2">
<div className="ui-card p-2.5 md:p-3">
<div className="flex items-center justify-between">
<h3 className="text-sm font-semibold text-foreground"></h3>
<span className="rounded bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground">{backlinks.length}</span>
</div>
<p className="mt-1 text-[11px] text-muted-foreground"></p>
<div className="mt-2 flex flex-wrap gap-1.5">
{backlinks.length > 0 ? (
backlinks.map((item) => (
<button
key={item.id}
onClick={() => setActivePageId(item.id)}
className="rounded-md border border-border/70 bg-muted/40 px-2.5 py-1 text-xs text-foreground transition-colors hover:bg-accent"
className="rounded-md border border-border/70 bg-muted/40 px-2 py-0.5 text-[11px] text-foreground transition-colors hover:bg-accent"
>
{item.icon ? `${item.icon} ` : ""}
{item.title}
</button>
))
) : (
<span className="text-xs text-muted-foreground"></span>
<span className="text-[11px] text-muted-foreground"></span>
)}
</div>
</div>
</div>
<div className="ui-card p-3 md:p-4">
<h3 className="text-sm font-semibold text-foreground"></h3>
<p className="mt-1 text-xs text-muted-foreground"> `[[页面名]]` </p>
<div className="mt-3 flex flex-wrap gap-2">
<div className="ui-card p-2.5 md:p-3">
<div className="flex items-center justify-between">
<h3 className="text-sm font-semibold text-foreground"></h3>
<span className="rounded bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground">{unresolvedLinks.length}</span>
</div>
<p className="mt-1 text-[11px] text-muted-foreground"></p>
<div className="mt-2 flex flex-wrap gap-1.5">
{unresolvedLinks.length > 0 ? (
unresolvedLinks.map((title) => (
<button
@@ -347,19 +357,20 @@ export default function Home() {
onClick={async () => {
await addPage(null, "file", { title, content: "" });
}}
className="rounded-md border border-dashed border-border bg-muted/30 px-2.5 py-1 text-xs text-foreground transition-colors hover:bg-accent"
className="rounded-md border border-dashed border-border bg-muted/30 px-2 py-0.5 text-[11px] text-foreground transition-colors hover:bg-accent"
title={`创建页面:${title}`}
>
+ {title}
</button>
))
) : (
<span className="text-xs text-muted-foreground"></span>
<span className="text-[11px] text-muted-foreground"></span>
)}
</div>
</div>
</div>
<div className="ui-card p-3 md:p-4">
<div className="ui-card p-2.5 md:p-3">
<button
onClick={() => setIsHistoryOpen((v) => !v)}
className="flex w-full items-center justify-between rounded-md px-1 py-1 text-left transition-colors hover:bg-muted/45"
@@ -373,9 +384,9 @@ export default function Home() {
</div>
<ChevronDown size={15} className={cn("text-muted-foreground transition-transform", isHistoryOpen && "rotate-180")} />
</button>
<p className="mt-1 text-xs text-muted-foreground"></p>
<p className="mt-1 text-[11px] text-muted-foreground"></p>
{isHistoryOpen && (
<div className="mt-3 space-y-3">
<div className="mt-2 space-y-2.5">
{localHistory.length > 0 ? (
<>
<div className="rounded-lg border border-border/60 bg-muted/20 p-2">