import React, { HTMLAttributes, ReactNode, useMemo, useState } from "react" import { Button, ButtonProps } from "../Button"; import { Colors } from "../colors"; export interface DropDownProps extends HTMLAttributes { buttonProps?: ButtonProps; header?: string; arrow?: boolean; menuItems?: { title: string; onClick: () => void; disabled?: boolean; leftNode?: ReactNode; rightNode?: ReactNode; }[]; background?: Colors; } const DropDown = ({ className, buttonProps, menuItems, header, arrow = false, background, ...props }: DropDownProps) => { const baseId = (Math.random() * 100000).toPrecision(); const [active, setActive] = useState(); const classes = useMemo(() => { return [ 'dropdown-menu', arrow && 'dropdown-menu-arrow', background && `bg-${background}`, className, ].filter(Boolean).join(' '); }, [className, arrow, background]); return (
) } export default DropDown;