import React from "react";
import _ from "lodash";
import { View } from "react-native";
import { Text } from ".";
import { getMainBrandingColourFromState } from "../colours";
import { InlineButton } from "./InlineButton";
import { Services } from "../config";
import { connect } from "react-redux";
import Header from "./Header";
const Forbidden = ({
  colourBrandingMain,
  title,
  description
}) => {
  const goBack = () => {
    Services.navigation.goBack();
  };
  return /*#__PURE__*/React.createElement(View, {
    style: {
      flex: 1,
      backgroundColor: "#fff"
    }
  }, /*#__PURE__*/React.createElement(Header, {
    leftIcon: "angle-left",
    onPressLeft: goBack
  }), /*#__PURE__*/React.createElement(View, {
    style: {
      padding: 16
    }
  }, /*#__PURE__*/React.createElement(Text, {
    type: "pageHeading",
    style: {
      color: colourBrandingMain
    }
  }, !_.isEmpty(title) ? title : "Oops!"), /*#__PURE__*/React.createElement(Text, {
    type: "body",
    style: {
      marginTop: 10
    }
  }, !_.isEmpty(description) ? description : "It seems this item is no longer accessible. It may have been removed or your access might have changed."), /*#__PURE__*/React.createElement(View, {
    style: {
      marginTop: 20
    }
  }, /*#__PURE__*/React.createElement(InlineButton, {
    onPress: goBack,
    color: colourBrandingMain
  }, "Go back"))));
};
const mapStateToProps = state => {
  return {
    colourBrandingMain: getMainBrandingColourFromState(state)
  };
};
const forbidden = connect(mapStateToProps, {}, null, {
  forwardRef: true
})(Forbidden);
export { forbidden as Forbidden };
//# sourceMappingURL=Forbidden.js.map