"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.BasicMenuItem = void 0;
const tslib_1 = require("tslib");
const classnames_1 = tslib_1.__importDefault(require("classnames"));
const react_1 = tslib_1.__importDefault(require("react"));
const BasicMenuItem = ({ id, label, type, focusMode, onClick }) => {
    const [menuOpen, setMenuOpen] = react_1.default.useState(false);
    const handleMenuItemClick = react_1.default.useCallback(() => {
        if (focusMode) {
            setMenuOpen(true);
        }
        else {
            setMenuOpen((r) => !r);
        }
        onClick(id);
    }, [id]);
    const handleMouseOver = react_1.default.useCallback(() => { }, [id, focusMode]);
    if (type === 'divider') {
        return react_1.default.createElement("div", { className: 'basic_menu_item_divider' });
    }
    return (react_1.default.createElement("div", { className: (0, classnames_1.default)('basic_menu_item', { ['menu-open']: menuOpen }), onMouseOver: handleMouseOver, onClick: handleMenuItemClick }, label));
};
exports.BasicMenuItem = BasicMenuItem;
//# sourceMappingURL=menubar-item.js.map