mirror of
https://github.com/Zagrios/bs-manager.git
synced 2026-07-03 14:08:25 +02:00
fix fake items in dropdown
This commit is contained in:
@@ -22,6 +22,8 @@ type Props = {
|
||||
|
||||
export function BsmDropdownButton({className, items, align, withBar = true, icon = "settings", buttonClassName, menuTranslationY, children, text, textClassName}: Props) {
|
||||
|
||||
console.log("DROPDOWN", items);
|
||||
|
||||
const [expanded, setExpanded] = useState(false)
|
||||
const t = useTranslation();
|
||||
const ref = useRef(null)
|
||||
@@ -44,7 +46,7 @@ export function BsmDropdownButton({className, items, align, withBar = true, icon
|
||||
<div ref={ref} className={className}>
|
||||
<BsmButton onClick={() => setExpanded(!expanded)} className={buttonClassName ?? defaultButtonClassName} icon={icon} active={expanded} onClickOutside={handleClickOutside} withBar={withBar} text={text}/>
|
||||
<div className={`py-1 w-fit absolute cursor-pointer top-[calc(100%-4px)] rounded-md bg-inherit text-sm text-gray-800 dark:text-gray-200 shadow-md shadow-black transition-[scale] ease-in-out ${alignClass}`} style={{scale: expanded ? "1" : "0", translate: `0 ${menuTranslationY}`}}>
|
||||
{ items?.map((i) => (
|
||||
{ items?.map((i) => i && (
|
||||
<div key={crypto.randomUUID()} onClick={() => i.onClick?.()} className="flex w-full px-3 py-2 hover:backdrop-brightness-150">
|
||||
{i.icon && <BsmIcon icon={i.icon} className="h-5 w-5 mr-1 text-inherit"/>}
|
||||
<span className="w-max">{t(i.text)}</span>
|
||||
|
||||
Reference in New Issue
Block a user