import React from 'react'; import { Sidebar } from './Sidebar'; import { Header } from './Header'; import { Breadcrumb, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, } from '../ui/breadcrumb'; interface LayoutProps { children: React.ReactNode; currentView: string; setCurrentView: (view: string) => void; } const LABELING_SUB_VIEWS = ['Label Categories', 'Label Types', 'Label Templates', 'Multiple Options']; function getBreadcrumbItems(title: string): { label: string; view: string }[] { const items: { label: string; view: string }[] = [{ label: 'Home', view: 'Dashboard' }]; if (title === 'Labels' || title === 'Label Categories' || title === 'Label Types' || title === 'Label Templates' || title === 'Multiple Options') { if (LABELING_SUB_VIEWS.includes(title)) { items.push({ label: 'Labeling', view: 'Labels' }); } items.push({ label: title, view: title }); } else { items.push({ label: title, view: title }); } return items; } export function Layout({ children, currentView, setCurrentView }: LayoutProps) { const breadcrumbItems = getBreadcrumbItems(currentView); return (