I have two problems. First is once I click the button again if the dropdown is opening, it should close. Second, I need to filter out the values that are shown on it. Once it has been selected, it should disappear from the available options?
Check my code sandbox here
<DropdownMenu show={isComponentVisible} ref={ref}>
{statuses.map(({ id, statusName }) => (
<MenuButton
type="button"
key={id}
onClick={() => handleSelect(statusName)}
>
{statusName}
</MenuButton>
))}
</DropdownMenu>