import _extends from "@babel/runtime-corejs3/helpers/extends";
import _objectWithoutPropertiesLoose from "@babel/runtime-corejs3/helpers/objectWithoutPropertiesLoose";
// @flow
import React from 'react';
import MapViewContent from './MapViewContent';
/*:: import { type MapViewContentProps, type MapInstance } from './MapViewContent';*/

import ViewWrapper from '../ViewWrapper';
/*:: import { type CommonViewProps } from '../ViewWrapper';*/

/*:: type Props = {
  ...$Exact<CommonViewProps>,
  ...$Exact<MapViewContentProps>
}*/

const MapView = (_ref, ref) => {
  let {
    observations,
    onUpdateObservation,
    onDeleteObservation,
    presets,
    filter,
    getMediaUrl
  }
  /*: Props*/
  = _ref,
      otherProps = _objectWithoutPropertiesLoose(_ref, ["observations", "onUpdateObservation", "onDeleteObservation", "presets", "filter", "getMediaUrl"]);

  return /*#__PURE__*/React.createElement(ViewWrapper, {
    observations: observations,
    onUpdateObservation: onUpdateObservation,
    onDeleteObservation: onDeleteObservation,
    presets: presets,
    filter: filter,
    getMediaUrl: getMediaUrl
  }, ({
    onClickObservation,
    filteredObservations,
    getPreset,
    getMedia
  }) => /*#__PURE__*/React.createElement(MapViewContent, _extends({
    ref: ref,
    onClick: onClickObservation,
    observations: filteredObservations,
    getPreset: getPreset,
    getMedia: getMedia
  }, otherProps)));
};

export default /*#__PURE__*/React.forwardRef(MapView);
//# sourceMappingURL=MapView.js.map