diff --git a/src/renderer/components/shared/bsm-dropdown-button.component.tsx b/src/renderer/components/shared/bsm-dropdown-button.component.tsx new file mode 100644 index 00000000..ab93e4e0 --- /dev/null +++ b/src/renderer/components/shared/bsm-dropdown-button.component.tsx @@ -0,0 +1,25 @@ +import { useState } from "react" +import { BsmIconType } from "../svgs/bsm-icon.component" +import { BsmButton } from "./bsm-button.component" +import { BsmIcon } from "../svgs/bsm-icon.component" + +export interface DropDownItem {id: number, text: string, icon?: BsmIconType} + +export function BsmDropdownButton({className, items, align, onItemClick}: {className?: string, items?: DropDownItem[], align?: "left"|"right", onItemClick?: (id: number) => void}) { + + const [expanded, setExpanded] = useState(false) + + return ( +
+ setExpanded(!expanded)} className='relative z-[1] p-1 rounded-md text-inherit w-full h-full shadow-md shadow-black' icon="settings" active={expanded} onClickOutside={() => {setExpanded(false)}}/> +
+ { items?.map(i => +
onItemClick(i.id)} className="flex justify-start items-center w-full pr-3 pl-3 pt-2 pb-2 hover:bg-main-color-3"> + {i.icon && } + {i.text} +
+ )} +
+
+ ) +}