grain.social is a photo sharing platform built on atproto.
1import { cn } from "@bigmoves/bff/components";
2
3type BreadcrumbItem = {
4 label: string;
5 href?: string;
6};
7
8export function Breadcrumb(
9 { class: classProp, items }: Readonly<
10 { class?: string; items: BreadcrumbItem[] }
11 >,
12) {
13 return (
14 <nav
15 className={cn("mb-4 text-sm text-zinc-500 dark:text-zinc-300", classProp)}
16 >
17 {items.map((item, idx) => (
18 <>
19 {item.href
20 ? (
21 <a href={item.href} className="text-sky-500 hover:underline">
22 {item.label}
23 </a>
24 )
25 : (
26 <span className="text-zinc-700 dark:text-zinc-100">
27 {item.label}
28 </span>
29 )}
30 {idx < items.length - 1 && <span className="mx-2">></span>}
31 </>
32 ))}
33 </nav>
34 );
35}