"use strict";

require("core-js/modules/es.array.iterator.js");
require("core-js/modules/es.object.define-property.js");
require("core-js/modules/es.object.get-own-property-descriptor.js");
require("core-js/modules/es.object.to-string.js");
require("core-js/modules/es.string.iterator.js");
require("core-js/modules/es.weak-map.js");
require("core-js/modules/esnext.weak-map.delete-all.js");
require("core-js/modules/esnext.weak-map.emplace.js");
require("core-js/modules/web.dom-collections.iterator.js");
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
var _typeof = require("@babel/runtime/helpers/typeof");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.FcrActionButton = void 0;
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
var _react = _interopRequireWildcard(require("react"));
var _ = require(".");
var _classnames = _interopRequireDefault(require("classnames"));
var _jsxRuntime = require("react/jsx-runtime");
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
var FcrActionButton = exports.FcrActionButton = function FcrActionButton(props) {
  var children = props.children,
    styleType = props.styleType,
    _props$active = props.active,
    active = _props$active === void 0 ? false : _props$active,
    _props$size = props.size,
    size = _props$size === void 0 ? 'large' : _props$size,
    iconType = props.iconType;
  var _useState = (0, _react.useState)(false),
    _useState2 = (0, _slicedToArray2["default"])(_useState, 2),
    hover = _useState2[0],
    setHover = _useState2[1];
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_.FcrButton, {
    onClick: props.onClick,
    onHover: setHover,
    shape: "rounded",
    className: (0, _classnames["default"])("fcr-action-button fcr-action-button-".concat(size), (0, _defineProperty2["default"])((0, _defineProperty2["default"])((0, _defineProperty2["default"])((0, _defineProperty2["default"])({}, "fcr-action-button-".concat(styleType), !!styleType), 'fcr-action-button-active', active), 'fcr-action-button-show-icon', !!iconType), 'fcr-action-button-icon-only', !children)),
    size: "XXS",
    postIcon: iconType,
    postIconProps: {
      colors: {
        iconPrimary: active || styleType === 'primary' ? 'var(--fcr_ui_scene_white10)' : hover ? 'var(--fcr_web_ui_scene_mainicon2)' : 'var(--fcr_ui_scene_icontext1)'
      }
    },
    children: children
  });
};