Files
assetx/webapp/components/layout/Breadcrumb.tsx
default 2ee4553b71 init: 初始化 AssetX 项目仓库
包含 webapp(Next.js 用户端)、webapp-back(Go 后端)、
antdesign(管理后台)、landingpage(营销落地页)、
数据库 SQL 和配置文件。
2026-03-27 11:26:43 +00:00

54 lines
1.4 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"use client";
import Image from "next/image";
import Link from "next/link";
interface BreadcrumbItem {
label: string;
href?: string;
}
interface BreadcrumbProps {
items: BreadcrumbItem[];
}
export default function Breadcrumb({ items }: BreadcrumbProps) {
return (
<nav className="flex items-center gap-[3px] h-5">
{items.map((item, index) => {
const isLast = index === items.length - 1;
const content = (
<span
className={`text-sm font-medium leading-[150%] ${
isLast
? "text-text-primary dark:text-white font-bold"
: "text-text-tertiary dark:text-gray-400 hover:text-text-secondary dark:hover:text-gray-300 transition-colors cursor-pointer"
}`}
>
{item.label}
</span>
);
return (
<div key={index} className="flex items-center gap-[3px]">
{!isLast && item.href ? (
<Link href={item.href}>{content}</Link>
) : (
content
)}
{!isLast && (
<Image
src="/icons/ui/icon-chevron-right.svg"
alt=""
width={14}
height={14}
className="flex-shrink-0 dark:invert"
/>
)}
</div>
);
})}
</nav>
);
}