Fertig
This commit is contained in:
24
components/breadcrumbs.tsx
Normal file
24
components/breadcrumbs.tsx
Normal file
@@ -0,0 +1,24 @@
|
||||
import Link from "next/link";
|
||||
|
||||
type BreadcrumbItem = {
|
||||
name: string;
|
||||
path: string;
|
||||
};
|
||||
|
||||
export function Breadcrumbs({ items }: { items: BreadcrumbItem[] }) {
|
||||
return (
|
||||
<nav aria-label="Breadcrumb">
|
||||
<ol className="breadcrumbs">
|
||||
{items.map((item, index) => {
|
||||
const isLast = index === items.length - 1;
|
||||
|
||||
return (
|
||||
<li key={item.path}>
|
||||
{isLast ? <span>{item.name}</span> : <Link href={item.path}>{item.name}</Link>}
|
||||
</li>
|
||||
);
|
||||
})}
|
||||
</ol>
|
||||
</nav>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user