import React, { Component } from 'react';
import { GoogleMap, Marker } from 'react-google-maps';
// import UI from 'jqestate.ru/components/ui';

export default class extends Component {
  render() {
    // const { isFetching } = this.props.place;

    const { details } = this.props;
    const containerProps = {
      style: {
        height: `20rem`,
      },
    };

    if (details) {
      return (
        <GoogleMap containerProps={containerProps} ref="map" googleMapsApi={typeof google !== `undefined` ? google.maps : null} mapTypeId={ google.maps.MapTypeId.ROADMAP } zoom={12} center={{ lat: details.latitude, lng: details.longitude }}>
          <Marker position={{ lat: details.latitude, lng: details.longitude }} key="1" />
        </GoogleMap>
      );
    }

    // if (isFetching) {
    //   return <UI.Loading />;
    // }

    return null;
  }
}
