feat: improve app ui and project metadata
This commit is contained in:
@@ -1,6 +1,21 @@
|
||||
"use client";
|
||||
|
||||
import Link from "next/link";
|
||||
import {
|
||||
Blocks,
|
||||
BookOpen,
|
||||
Boxes,
|
||||
ClipboardCheck,
|
||||
Flag,
|
||||
LayoutTemplate,
|
||||
ListTree,
|
||||
Palette,
|
||||
PenLine,
|
||||
Settings,
|
||||
Sparkles,
|
||||
Workflow,
|
||||
type LucideIcon,
|
||||
} from "lucide-react";
|
||||
import { usePathname } from "next/navigation";
|
||||
|
||||
import {
|
||||
@@ -54,6 +69,22 @@ export function NavItems({ projectId, activeNav, onNavigate }: NavItemsProps) {
|
||||
);
|
||||
}
|
||||
|
||||
function navIcon(item: NavItem): LucideIcon {
|
||||
if (item.key === "write") return PenLine;
|
||||
if (item.key === "outline") return ListTree;
|
||||
if (item.key === "foreshadow") return Flag;
|
||||
if (item.key === "review") return ClipboardCheck;
|
||||
if (item.key === "chains") return Workflow;
|
||||
if (item.key === "style") return Palette;
|
||||
if (item.key === "codex") return BookOpen;
|
||||
if (item.key === "toolbox") return Sparkles;
|
||||
if (item.key === "rules") return Boxes;
|
||||
if (item.key === "skills") return Blocks;
|
||||
if (item.href === "/templates") return LayoutTemplate;
|
||||
if (item.href === "/settings/providers") return Settings;
|
||||
return BookOpen;
|
||||
}
|
||||
|
||||
function NavLink({
|
||||
item,
|
||||
active,
|
||||
@@ -63,18 +94,20 @@ function NavLink({
|
||||
active: boolean;
|
||||
onNavigate?: () => void;
|
||||
}) {
|
||||
const Icon = navIcon(item);
|
||||
return (
|
||||
<li>
|
||||
<Link
|
||||
href={item.href}
|
||||
onClick={onNavigate}
|
||||
aria-current={active ? "page" : undefined}
|
||||
className={`flex items-center gap-2 rounded px-3 py-2 text-sm ${
|
||||
className={`flex items-center gap-2 rounded px-3 py-2 text-sm transition-colors ${
|
||||
active
|
||||
? "border-l-2 border-cinnabar bg-[var(--color-cinnabar-wash)] text-cinnabar"
|
||||
: "text-ink hover:bg-[var(--color-cinnabar-wash)]"
|
||||
: "border-l-2 border-transparent text-ink hover:bg-[var(--color-cinnabar-wash)] hover:text-cinnabar"
|
||||
}`}
|
||||
>
|
||||
<Icon className="h-4 w-4 shrink-0" aria-hidden="true" />
|
||||
{item.label}
|
||||
</Link>
|
||||
</li>
|
||||
|
||||
Reference in New Issue
Block a user