Files
jiang13-bbs/frontend/components/site-doc/SiteDocBreadcrumb.tsx
freefire d784b0ea7a feat: 交付官方 Docker 运行时,外观改背景图并下线自定义 CSS/JS
站点/后台分轨背景与用户列表排序一并落地;生产 CORS 改走 SITE_URL,健康检查带版本号。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-18 05:27:33 +08:00

44 lines
1.3 KiB
TypeScript

import Link from "next/link";
import { ChevronRight } from "lucide-react";
export type Crumb = { href?: string; label: string };
/** 位置指引:嵌在正文面板顶部,不单独成块 */
export default function SiteDocBreadcrumb({
items,
className,
}: {
items: Crumb[];
className?: string;
}) {
return (
<nav
className={`j13-page-crumb meta flex items-center gap-1 flex-wrap text-[12.5px] leading-none ${className ?? ""}`}
aria-label="面包屑"
>
{items.map((item, i) => {
const last = i === items.length - 1;
const cls = last ? "truncate" : "shrink-0";
return (
<span key={`${item.label}-${i}`} className="inline-flex items-center gap-1 min-w-0">
{i > 0 ? <ChevronRight size={12} className="shrink-0 opacity-70" aria-hidden /> : null}
{item.href ? (
<Link
href={item.href}
className={`hover:text-[var(--accent)] transition-colors ${cls}`}
style={last ? { color: "var(--accent)" } : undefined}
>
{item.label}
</Link>
) : (
<span className={cls} style={last ? { color: "var(--accent)" } : undefined}>
{item.label}
</span>
)}
</span>
);
})}
</nav>
);
}