import { NavigationItemType, } from "../../models/index.js";
export const getItemClickHandler = ({ column, index, onActiveItemChange, activeItemId }) => (e) => {
    const id = `${column}-${index}`;
    if (e) {
        e.stopPropagation();
    }
    onActiveItemChange(id === activeItemId ? undefined : `${column}-${index}`);
};
const isButtonItem = (item) => item.type === NavigationItemType.Button;
const isDropdownItem = (item) => item.type === NavigationItemType.Dropdown;
const iconSizeKey = 'iconSize';
export function getNavigationItemWithIconSize(iconSize = 20) {
    const getItem = (item) => {
        const newItem = { ...item };
        if ('items' in newItem && isDropdownItem(newItem)) {
            newItem.items = newItem.items.map(getItem);
        }
        if (!(iconSizeKey in newItem) && !isButtonItem(newItem)) {
            newItem.iconSize = iconSize;
        }
        return newItem;
    };
    return getItem;
}
//# sourceMappingURL=utils.js.map
