Files
assetx/components/Breadcrumb.tsx

40 lines
954 B
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.

import Image from "next/image";
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) => (
<div key={index} className="flex items-center gap-[3px]">
<span
className={`text-sm font-medium leading-[150%] ${
index === items.length - 1
? "text-text-primary font-bold"
: "text-text-tertiary"
}`}
>
{item.label}
</span>
{index < items.length - 1 && (
<Image
src="/icon-chevron-right.svg"
alt=""
width={14}
height={14}
className="flex-shrink-0"
/>
)}
</div>
))}
</nav>
);
}