import { Breadcrumb, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, } from "@/src/components/ui/breadcrumb"; import { createBreadcrumbItems } from "@/src/features/folders/utils"; import { Home, Slash } from "lucide-react"; /** * Breadcrumb navigation for folders. * * @param currentFolderPath - Name-based folder path for navigation * @param navigateToFolder - Callback to navigate to a folder */ export const FolderBreadcrumb = ({ currentFolderPath, navigateToFolder, }: { currentFolderPath: string; navigateToFolder: (folderPath: string | undefined) => void; }) => { return (
navigateToFolder(undefined)} > {createBreadcrumbItems(currentFolderPath).flatMap( (item, index, array) => [ index > 0 && ( ), {index === array.length - 1 ? ( {item.name} ) : ( navigateToFolder(item.folderPath)} > {item.name} )} , ], )}
); };