"use strict";
var __assign = (this && this.__assign) || function () {
    __assign = Object.assign || function(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
                t[p] = s[p];
        }
        return t;
    };
    return __assign.apply(this, arguments);
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Menu = void 0;
var react_1 = __importDefault(require("react"));
var ramda_1 = require("ramda");
var Add_1 = __importDefault(require("@mui/icons-material/Add"));
var ReactSelectMenuWithPopper_1 = require("../../../ReactSelectMenuWithPopper");
var styles_1 = require("./styles");
var Menu = function (props) {
    var _a = props.selectProps, onCreate = _a.onCreate, createLabel = _a.createLabel, inputValue = _a.inputValue, components = _a.components, canCreateOption = _a.canCreateOption, children = props.children;
    var styles = (0, styles_1.useStyles)();
    return (react_1.default.createElement(ReactSelectMenuWithPopper_1.ReactSelectMenuWithPopper, __assign({}, props),
        children,
        createLabel && !(0, ramda_1.prop)('Group', components) && canCreateOption() && (react_1.default.createElement("span", { className: styles.addLabel, onClick: function () { return onCreate(inputValue); } },
            react_1.default.createElement(Add_1.default, { className: styles.addIcon }),
            createLabel))));
};
exports.Menu = Menu;
