"use strict";

exports.__esModule = true;
exports.default = void 0;
var _react = _interopRequireWildcard(require("react"));
var _reactNative = require("react-native");
var _lottieReactNative = _interopRequireDefault(require("lottie-react-native"));
var _templateContext = require("../../template/app-review/template-context");
var _shadow = require("../../variables/shadow");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
const createStyleSheet = theme => _reactNative.StyleSheet.create({
  animation: {
    marginBottom: 12,
    width: 132,
    height: 132
  },
  // eslint-disable-next-line @coorpacademy/coorpacademy/no-overwriting-spread
  card: {
    alignItems: 'center',
    paddingTop: 32,
    paddingBottom: 24,
    borderRadius: 24,
    margin: 10,
    width: 280,
    height: 317,
    ..._shadow.BOX_STYLE,
    backgroundColor: theme.colors.white
  },
  cardTitle: {
    fontWeight: '400',
    fontSize: 32,
    lineHeight: 40,
    color: theme.colors.text.primary
  },
  reward: {
    alignItems: 'center'
  },
  rewardText: {
    fontWeight: '700',
    fontSize: 64,
    lineHeight: 77,
    marginHorizontal: 10
  },
  iconBig: {
    width: 70,
    height: 70
  },
  iconSmall: {
    width: 53,
    height: 53
  }
});
const CardCongrats = ({
  animationUri,
  Icon,
  value,
  text,
  iconColor,
  textColor,
  direction
}) => {
  const {
    theme
  } = (0, _templateContext.useTemplateContext)();
  const [styleSheet, setStylesheet] = (0, _react.useState)(null);
  (0, _react.useEffect)(() => {
    const _stylesheet = createStyleSheet(theme);
    setStylesheet(_stylesheet);
  }, [theme]);
  if (!styleSheet) {
    return null;
  }
  return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
    style: styleSheet.card
  }, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
    style: styleSheet.animation
  }, animationUri ? /*#__PURE__*/_react.default.createElement(_lottieReactNative.default, {
    source: {
      uri: animationUri
    },
    autoPlay: true,
    loop: false
  }) : null), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
    style: styleSheet.cardTitle
  }, text), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
    style: [styleSheet.reward, {
      flexDirection: direction
    }]
  }, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
    style: [styleSheet.rewardText, {
      color: textColor
    }]
  }, value), /*#__PURE__*/_react.default.createElement(Icon, {
    style: styleSheet.iconSmall,
    color: iconColor
  })));
};
var _default = exports.default = CardCongrats;
//# sourceMappingURL=index.native.js.map