Add ZXDB breadcrumbs and release places
Add ZXDB breadcrumbs on list/detail pages and group release magazine references by issue for clearer Places view. Signed-off-by: codex@lucy.xalior.com
This commit is contained in:
27
src/app/zxdb/components/ZxdbBreadcrumbs.tsx
Normal file
27
src/app/zxdb/components/ZxdbBreadcrumbs.tsx
Normal file
@@ -0,0 +1,27 @@
|
||||
import Link from "next/link";
|
||||
|
||||
type Crumb = {
|
||||
label: string;
|
||||
href?: string;
|
||||
};
|
||||
|
||||
export default function ZxdbBreadcrumbs({ items }: { items: Crumb[] }) {
|
||||
if (items.length === 0) return null;
|
||||
|
||||
const lastIndex = items.length - 1;
|
||||
|
||||
return (
|
||||
<nav aria-label="breadcrumb">
|
||||
<ol className="breadcrumb">
|
||||
{items.map((item, index) => {
|
||||
const isActive = index === lastIndex || !item.href;
|
||||
return (
|
||||
<li key={`${item.label}-${index}`} className={`breadcrumb-item${isActive ? " active" : ""}`} aria-current={isActive ? "page" : undefined}>
|
||||
{isActive ? item.label : <Link href={item.href ?? "#"}>{item.label}</Link>}
|
||||
</li>
|
||||
);
|
||||
})}
|
||||
</ol>
|
||||
</nav>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user