47 lines
1.2 KiB
TypeScript
47 lines
1.2 KiB
TypeScript
import Link from 'next/link';
|
|
import { ChevronRight, Home } from 'lucide-react';
|
|
|
|
interface BreadcrumbItem {
|
|
label: string;
|
|
href?: string;
|
|
}
|
|
|
|
interface BreadcrumbsProps {
|
|
items: BreadcrumbItem[];
|
|
}
|
|
|
|
export function Breadcrumbs({ items }: BreadcrumbsProps) {
|
|
return (
|
|
<nav className="flex" aria-label="Breadcrumb">
|
|
<ol className="flex items-center space-x-2">
|
|
<li>
|
|
<Link
|
|
href="/"
|
|
className="text-slate-500 hover:text-navy transition-colors"
|
|
>
|
|
<Home className="h-4 w-4" />
|
|
<span className="sr-only">Home</span>
|
|
</Link>
|
|
</li>
|
|
{items.map((item, index) => (
|
|
<li key={index} className="flex items-center">
|
|
<ChevronRight className="h-4 w-4 text-slate-400" />
|
|
{item.href ? (
|
|
<Link
|
|
href={item.href}
|
|
className="ml-2 text-sm text-slate-500 hover:text-navy transition-colors"
|
|
>
|
|
{item.label}
|
|
</Link>
|
|
) : (
|
|
<span className="ml-2 text-sm font-medium text-ink">
|
|
{item.label}
|
|
</span>
|
|
)}
|
|
</li>
|
|
))}
|
|
</ol>
|
|
</nav>
|
|
);
|
|
}
|