import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { ChevronDownIcon } from '../../../../lib/icons/ChevronDown.js';
import { Menu } from '../../../../lib/ui/Menu/Menu.js';
import { MenuItem } from '../../../../lib/ui/Menu/MenuItem.js';
export function FilterCategoryMenu({ label = t.filter, allLabel, options, hideAllOption = false, onSelect, onAllOptionSelect, buttonLabel, }) {
    const usableOptions = hideAllOption ? options : [allLabel, ...options];
    return (_jsxs("div", { className: 'seam-supported-device-table-filter-menu-wrap', children: [_jsx("p", { children: label }), _jsx(Menu, { renderButton: ({ onOpen }) => (_jsxs("button", { onClick: onOpen, children: [_jsx("span", { children: buttonLabel }), _jsx(ChevronDownIcon, {})] })), children: usableOptions.map((option, index) => (_jsx(MenuItem, { onClick: () => {
                        if (option === allLabel) {
                            onAllOptionSelect?.();
                        }
                        else {
                            onSelect(option);
                        }
                    }, children: _jsx("span", { children: option }) }, `${index}:${option}`))) })] }));
}
const t = {
    filter: 'Filter',
};
//# sourceMappingURL=FilterCategoryMenu.js.map