"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _react = _interopRequireDefault(require("react"));
var _reactstrap = require("reactstrap");
var _FIcon = _interopRequireDefault(require("../../../../commons/icons/FIcon.cjs"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var FISMClear = props => {
  var {
    value,
    readOnly,
    onClear
  } = props;
  var is_clearable = value != undefined && value.length > 0 && !readOnly;
  return /*#__PURE__*/_react.default.createElement(_reactstrap.InputGroupText, {
    onClick: ev => {
      is_clearable ? onClear(ev) : null;
    },
    style: {
      cursor: is_clearable ? 'pointer' : 'not-allowed',
      opacity: is_clearable ? 1 : 0.5
    }
  }, /*#__PURE__*/_react.default.createElement(_FIcon.default, {
    icon: "cross"
  }));
};
var _default = FISMClear;
exports.default = _default;