"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.ReactSelectOption = void 0;
var react_1 = __importDefault(require("react"));
var prop_types_1 = __importDefault(require("prop-types"));
var classnames_1 = __importDefault(require("classnames"));
var MenuItem_1 = __importDefault(require("@mui/material/MenuItem"));
var ExpandedValueTooltip_1 = require("../ExpandedValueTooltip");
var ReactSelectOption = function (props) {
    var _a;
    var innerProps = props.innerProps, innerRef = props.innerRef, children = props.children, isFocused = props.isFocused, isSelected = props.isSelected, label = props.label, classes = props.selectProps.classes;
    return (react_1.default.createElement(MenuItem_1.default, __assign({ className: (0, classnames_1.default)(classes.option, (_a = {}, _a[classes['option--selected']] = isSelected, _a)), ref: innerRef, selected: isFocused, component: "div" }, innerProps),
        react_1.default.createElement(ExpandedValueTooltip_1.ExpandedValueTooltip, { value: label },
            react_1.default.createElement("div", { className: classes['option--item'] }, children))));
};
exports.ReactSelectOption = ReactSelectOption;
exports.ReactSelectOption.propTypes = {
    children: prop_types_1.default.node,
    innerProps: prop_types_1.default.shape({
        id: prop_types_1.default.string.isRequired,
        key: prop_types_1.default.string,
        onClick: prop_types_1.default.func.isRequired,
        onMouseMove: prop_types_1.default.func.isRequired,
        onMouseOver: prop_types_1.default.func.isRequired,
        tabIndex: prop_types_1.default.number.isRequired
    }).isRequired,
    innerRef: prop_types_1.default.oneOfType([
        prop_types_1.default.oneOf([null]),
        prop_types_1.default.func,
        prop_types_1.default.shape({
            current: prop_types_1.default.any.isRequired
        })
    ]),
    isFocused: prop_types_1.default.bool.isRequired,
    isSelected: prop_types_1.default.bool.isRequired,
    label: prop_types_1.default.string,
    selectProps: prop_types_1.default.shape({
        classes: prop_types_1.default.shape({
            option: prop_types_1.default.string,
            'option--selected': prop_types_1.default.string
        })
    })
};
