function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
import React, { Component } from "react";
import _ from "lodash";
import { TouchableOpacity } from "react-native";
import { Text } from "./Text";
import { Icon } from "@rneui/themed";
import { connect } from "react-redux";
import { TEXT_DARK, getMainBrandingColourFromState } from "../colours";
class DropDownItem extends Component {
  constructor(...args) {
    super(...args);
    _defineProperty(this, "state", {});
  }
  renderIcon() {
    if (!_.isUndefined(this.props.icon)) {
      return /*#__PURE__*/React.createElement(Icon, {
        name: this.props.icon,
        type: "font-awesome",
        style: styles.dropDownItem_Icon,
        iconStyle: [styles.dropDownItem_IconStyle, {
          fontSize: 16,
          color: this.props.colourBrandingMain
        }]
      });
    }
    return null;
  }
  render() {
    return /*#__PURE__*/React.createElement(TouchableOpacity, {
      style: [styles.container, this.props.last && {
        marginBottom: 0
      }, this.props.style],
      onPress: this.props.onPress,
      activeOpacity: 0.6
    }, this.renderIcon(), /*#__PURE__*/React.createElement(Text, {
      style: [styles.text, this.props.textStyle]
    }, this.props.text));
  }
}
const styles = {
  container: {
    flexDirection: "row",
    marginBottom: 12,
    minHeight: 18,
    width: "100%",
    position: "relative"
  },
  text: {
    fontFamily: "sf-medium",
    fontSize: 16,
    lineHeight: 18,
    color: TEXT_DARK,
    backgroundColor: "transparent"
  },
  dropDownItem_Icon: {
    marginRight: 8,
    width: 18,
    alignSelf: "center"
  },
  dropDownItem_IconStyle: {
    fontSize: 16,
    lineHeight: 18,
    textAlign: "center"
  }
};
const mapStateToProps = state => {
  return {
    colourBrandingMain: getMainBrandingColourFromState(state)
  };
};
const dropDownItem = connect(mapStateToProps, {})(DropDownItem);
export { dropDownItem as DropDownItem };
//# sourceMappingURL=DropDownItem.js.map