"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _react = _interopRequireDefault(require("react"));
var _styledModalComponents = require("./styledModalComponents");
var _icons = require("../../assets/icons");
var _Button = _interopRequireDefault(require("../styled/Button"));
var _reactNative = require("react-native");
var _reactNativeSafeAreaContext = require("react-native-safe-area-context");
var _jsxRuntime = require("react/jsx-runtime");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
const ModalHeaderComponent = ({
  handleCloseModal,
  headerTitle,
  rightMenu,
  leftMenu
}) => {
  // The library's full-screen modals are an absolute-fill overlay inside
  // ModalBackground (NOT a native Modal), so the OS doesn't apply any
  // status-bar inset automatically — we have to. SafeAreaProvider is
  // mounted by ReduxWrapper, so this reads the live per-device inset
  // (notch / Dynamic Island / nothing).
  const insets = (0, _reactNativeSafeAreaContext.useSafeAreaInsets)();
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styledModalComponents.HeaderContainer, {
    style: {
      paddingTop: insets.top + 8
    },
    children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_styledModalComponents.HeaderLeft, {
      children: leftMenu ? leftMenu : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
        children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, {
          EndIcon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.BackIcon, {}),
          onPress: handleCloseModal
        }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
          children: headerTitle ?? 'Go back'
        })]
      })
    }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_styledModalComponents.HeaderRight, {
      children: rightMenu
    })]
  });
};
var _default = exports.default = ModalHeaderComponent;
//# sourceMappingURL=ModalHeaderComponent.js.map