mirror of
https://git.meshkee.com/Meshkee/dashboards.git
synced 2026-08-11 22:30:58 +04:30
Includes business, customer, and super-admin apps with shared packages and production deploy scripts. Co-authored-by: Cursor <cursoragent@cursor.com>
39 lines
1.1 KiB
TypeScript
39 lines
1.1 KiB
TypeScript
import { Link } from 'react-router-dom'
|
|
import { ChevronRight } from 'lucide-react'
|
|
import styles from './Breadcrumbs.module.css'
|
|
|
|
export interface BreadcrumbItem {
|
|
label: string
|
|
href?: string
|
|
}
|
|
|
|
interface BreadcrumbsProps {
|
|
items: BreadcrumbItem[]
|
|
}
|
|
|
|
export function Breadcrumbs({ items }: BreadcrumbsProps) {
|
|
return (
|
|
<nav className={styles.breadcrumbs} aria-label="Breadcrumb">
|
|
<ol className={styles.list}>
|
|
{items.map((item, index) => {
|
|
const isLast = index === items.length - 1
|
|
return (
|
|
<li key={`${item.label}-${index}`} className={styles.item}>
|
|
{index > 0 && (
|
|
<ChevronRight size={14} className={styles.separator} aria-hidden="true" />
|
|
)}
|
|
{item.href && !isLast ? (
|
|
<Link to={item.href} className={styles.link}>
|
|
{item.label}
|
|
</Link>
|
|
) : (
|
|
<span className={isLast ? styles.current : styles.text}>{item.label}</span>
|
|
)}
|
|
</li>
|
|
)
|
|
})}
|
|
</ol>
|
|
</nav>
|
|
)
|
|
}
|