"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.AdaptableButtonComponent = void 0;
const tslib_1 = require("tslib");
const React = tslib_1.__importStar(require("react"));
const Icon_1 = require("../../../components/Icon");
const SimpleButton_1 = tslib_1.__importDefault(require("../../../components/SimpleButton"));
const AdaptableContext_1 = require("../../AdaptableContext");
// This component is connected to adaptable and know about custom icons
const AdaptableButtonComponent = (props) => {
    let icon = props.icon;
    const adaptable = (0, AdaptableContext_1.useAdaptable)();
    if ((0, Icon_1.isAdaptableSystemIcon)(icon)) {
        icon = adaptable.api.userInterfaceApi.internalApi.prepareAdaptableIconDef(icon);
    }
    return React.createElement(SimpleButton_1.default, { ...props, icon: icon });
};
exports.AdaptableButtonComponent = AdaptableButtonComponent;
