diff --git a/src/components/global/Breadcrumbs.tsx b/src/components/global/Breadcrumbs.tsx index d3081f9..1b02ef5 100644 --- a/src/components/global/Breadcrumbs.tsx +++ b/src/components/global/Breadcrumbs.tsx @@ -1,30 +1,75 @@ -"use client"; +"use client" -import { ChevronRight, HomeIcon } from "lucide-react"; -import Link from "next/link"; +import { + FolderIcon, + FolderOpenIcon, + HomeIcon, + ImageIcon, + InfoIcon, + LayersIcon, + TagIcon, + UserIcon, +} from "lucide-react" +import Link from "next/link" +import { usePathname } from "next/navigation" +import { Fragment, JSX } from "react" -export function Breadcrumbs({ - items, -}: { - items: { name: string; href?: string }[]; -}) { - return ( - - ); +const iconMap: Record = { + "about": , + "artists": , + "categories": , + "tags": , + "gallery": , + "album": , + "image": , +} + +export default function Breadcrumbs() { + const pathname = usePathname() + const rawSegments = pathname.split("/").filter(Boolean) + + // If path is just "/", return nothing + if (rawSegments.length === 0) return null + + // Special handling: remove "galleries" from breadcrumb trail + const segments = rawSegments.filter((seg, index) => + !(seg === "galleries" && index === 0) + ) + + return ( +
+ + + Home + + + {segments.length > 0 && {">"}} + + {segments.map((seg, i) => { + const href = "/" + rawSegments.slice(0, rawSegments.indexOf(seg) + 1).join("/") + const isLast = i === segments.length - 1 + const icon = iconMap[rawSegments[0]] || null + + return ( + + {i > 0 && {">"}} + {isLast ? ( + + {i === 0 && icon} + {decodeURIComponent(seg)} + + ) : ( + + {i === 0 && icon} + {decodeURIComponent(seg)} + + )} + + ) + })} +
+ ) } diff --git a/src/components/global/Header.tsx b/src/components/global/Header.tsx index 74ffb1d..2471ef0 100644 --- a/src/components/global/Header.tsx +++ b/src/components/global/Header.tsx @@ -1,17 +1,21 @@ import AnimateToggle from "./AnimateToggle"; +import Breadcrumbs from "./Breadcrumbs"; import ModeToggle from "./ModeToggle"; import NSFWToggle from "./NSFWToggle"; import TopNav from "./TopNav"; export default function Header() { return ( -
- -
- - - +
+
+ +
+ + + +
+
); } \ No newline at end of file