content: /*
   * Copyright (c) 2017.  Caipi Labs.  All rights reserved.
   *
   * This File is part of Caipi. You can redistribute it and/or modify
   * it under the terms of the GNU Affero General Public License as
   * published by the Free Software Foundation, either version 3 of the
   * License, or (at your option) any later version.
   * This program is distributed in the hope that it will be useful,
   * but WITHOUT ANY WARRANTY; without even the implied warranty of
   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   * GNU Affero General Public License for more details.
   * You should have received a copy of the GNU Affero General Public License
   * along with this program. If not, see <http://www.gnu.org/licenses/>.
   *  This project is dual licensed under AGPL and Commercial Licence.
   *  
   * @author : Nathanael Braun
   * @contact : caipilabs@gmail.com
   */
  
  'use strict';
  
  import React from 'react';
  
  import Image from 'App/ui/components/Image';
  
  
  class DefaultItem extends React.Component {
      getRouteTo() {
          var target = this.props.record.targetEtty;
          return super.getRouteTo(target.cls, target.objId);
      }
      onClick() {
  
      }
      getPreviewSrc() {
          var pts  = this.props.record
              && this.props.record.address
              && this.props.record.address.geoPoint;
          var zoom = this.props.record
              && this.props.record.address
              && this.props.record.address.zoom;
          //debugger;
          return super.getPreviewSrc()||pts&&pts[0]&&"!https://maps.googleapis.com/maps/api/staticmap?maptype=satellite&center=" +
              pts.slice().reverse().join(',') + "&zoom=" + Math.max(19,zoom) +
              "&size=800x800&key=AIzaSyA7XcGxipnIMdSSBJHn3tzeJe-fU3ilCak";
          // return super.getPreviewSrc()||pts&&pts[0]&&"https://maps.googleapis.com/maps/api/streetview?size=600x300&location=" +
          //     pts.slice().reverse().join(',') + "&heading=151.78&pitch=-0.26&key=AIzaSyA7XcGxipnIMdSSBJHn3tzeJe-fU3ilCak";
      }
  
      render() {
          var record = this.props.record;
  
          return [
  
                  this.getPreviewSrc() &&
                  <Image src={this.getPreviewSrc()} preload outfit
                         w={400} h={400}/>,
                  <div className="title">
                      {this.getLabel()}
                  </div>
              ]
      }
  
  }
  ;
  
  export default DefaultItem;