chore: import codes
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
'use client';
|
||||
|
||||
import React from 'react';
|
||||
|
||||
const Breadcrumb = ({ items = [], className = '' }) => {
|
||||
return (
|
||||
<nav
|
||||
aria-label="Breadcrumb"
|
||||
className={`inline-flex self-start bg-white dark:bg-neutral-800/30 border border-neutral-200 dark:border-neutral-700/30 rounded-xl overflow-hidden ${className}`}
|
||||
>
|
||||
<ol className="flex items-center">
|
||||
{items.map((item, index) => (
|
||||
<React.Fragment key={item.key ?? index}>
|
||||
{index !== 0 && (
|
||||
<span className="text-neutral-300 dark:text-neutral-600 text-xs select-none px-0.5">
|
||||
/
|
||||
</span>
|
||||
)}
|
||||
<li className="flex items-center">
|
||||
<button
|
||||
onClick={item.onClick}
|
||||
disabled={!item.onClick || item.active}
|
||||
className={[
|
||||
'px-3 py-1.5 text-xs font-medium transition-colors',
|
||||
item.active
|
||||
? 'text-black dark:text-white cursor-default'
|
||||
: item.onClick
|
||||
? 'text-neutral-500 hover:text-neutral-700 dark:hover:text-neutral-300 hover:bg-neutral-50 dark:hover:bg-neutral-700/20 cursor-pointer'
|
||||
: 'text-neutral-400 cursor-default',
|
||||
].filter(Boolean).join(' ')}
|
||||
>
|
||||
{item.label}
|
||||
</button>
|
||||
</li>
|
||||
</React.Fragment>
|
||||
))}
|
||||
</ol>
|
||||
</nav>
|
||||
);
|
||||
};
|
||||
|
||||
export default Breadcrumb;
|
||||
Reference in New Issue
Block a user