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);
};
import React from 'react';
import { prop } from 'ramda';
import AddIcon from '@mui/icons-material/Add';
import { ReactSelectMenuWithPopper } from '../../../ReactSelectMenuWithPopper';
import { useStyles } from './styles';
export 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 = useStyles();
    return (React.createElement(ReactSelectMenuWithPopper, __assign({}, props),
        children,
        createLabel && !prop('Group', components) && canCreateOption() && (React.createElement("span", { className: styles.addLabel, onClick: function () { return onCreate(inputValue); } },
            React.createElement(AddIcon, { className: styles.addIcon }),
            createLabel))));
};
