"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _styles = require("./styles");
var _hooks = require("../../../../../hooks");
var _icons = require("../../../../../../core/assets/icons");
var _reactNativeSvg = require("react-native-svg");
var _enums = require("../../../../../enums");
var _Typography = require("../../../../../../core/components/Typography/Typography");
var _reactNative = require("react-native");
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
function Action({
  iconProps,
  description,
  pageId = _enums.PageID.WildCardPage,
  componentId = _enums.ComponentID.WildCardComponent,
  elementId = _enums.ElementID.WildCardElement,
  label,
  ...props
}) {
  const {
    themeStyles,
    isExcluded,
    accessibilityId,
    config
  } = (0, _hooks.useAmityElement)({
    pageId,
    componentId,
    elementId
  });
  const {
    theme,
    styles
  } = (0, _styles.useStyles)(themeStyles);
  if (isExcluded) return null;
  return /*#__PURE__*/React.createElement(_reactNative.TouchableOpacity, _extends({
    style: styles.buttonContainer,
    testID: accessibilityId
  }, props), /*#__PURE__*/React.createElement(_reactNative.View, {
    style: styles.labelContainer
  }, iconProps.noContainer ? /*#__PURE__*/React.createElement(_reactNativeSvg.SvgXml, _extends({
    width: 24,
    height: 20,
    color: theme.colors.base
  }, iconProps)) : /*#__PURE__*/React.createElement(_reactNative.View, {
    style: styles.iconContainer
  }, /*#__PURE__*/React.createElement(_reactNativeSvg.SvgXml, _extends({
    width: 24,
    height: 20,
    color: theme.colors.base
  }, iconProps))), /*#__PURE__*/React.createElement(_Typography.Typography.Body, null, label ?? (config === null || config === void 0 ? void 0 : config.text))), /*#__PURE__*/React.createElement(_reactNative.View, {
    style: styles.labelContainer
  }, description && /*#__PURE__*/React.createElement(_Typography.Typography.Body, {
    style: styles.baseShade1Text
  }, description), /*#__PURE__*/React.createElement(_reactNativeSvg.SvgXml, {
    width: 24,
    height: 24,
    xml: (0, _icons.arrowRight)(),
    color: theme.colors.baseShade1
  })));
}
var _default = exports.default = Action;
//# sourceMappingURL=Action.js.map