Spaces:
Build error
Build error
File size: 1,379 Bytes
78dd858 4002561 78dd858 4aac406 78dd858 021b245 4aac406 78dd858 4002561 78dd858 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | import type { ReactNode } from 'react'
export interface MenuItem {
label: string
onClick?: () => void
disabled?: boolean
}
interface Props {
/** Left-aligned items (logo, menus) */
items?: MenuItem[]
/** Right-aligned content (search, status) */
right?: ReactNode
/** Extra CSS classes */
className?: string
}
export default function RetroMenuBar({ items = [], right, className = '' }: Props) {
return (
<nav
aria-label="Menu principal"
className={`
flex items-center
bg-retro-gray
border-b-retro border-retro-black
shadow-retro-outset
px-1 py-[2px]
select-none shrink-0
${className}
`}
>
{items.map((item, index) => (
<button
type="button"
key={`${index}-${item.label}`}
onClick={item.onClick}
disabled={item.disabled}
className={`
px-3 py-[2px]
text-retro-sm font-retro font-medium
${item.disabled
? 'text-retro-darkgray cursor-not-allowed'
: 'text-retro-black hover:bg-retro-black hover:text-retro-white cursor-pointer'
}
`}
>
{item.label}
</button>
))}
{right && (
<div className="ml-auto flex items-center gap-1">
{right}
</div>
)}
</nav>
)
}
|