import React, { Component, PropTypes } from 'react';
import RequestModal from 'jqestate.ru/components/modal/request';
import ShareModal from 'jqestate.ru/components/modal/share';

import UI from 'jqestate.ru/components/ui';
import Price from 'jqestate.ru/components/property/price';
// import PriceDelta from '../pricedelta';

import 'jqestate.ru/styles/property/info';

class PropertyInfo extends Component {
  static propTypes = {
    property: PropTypes.object.isRequired,
    dealType: PropTypes.string.isRequired,
    delta: PropTypes.object,
  }

  render() {
    const { property, delta, dealType } = this.props;
    const { location = {} } = property;

    return (
      <UI.Panel bsSize="sm" className="info">
        <div className="panel-body">
          <div className="info-price">
            <h2 className="info-price-primary">
              <Price deals={property.deals} dealType={dealType} />

              {delta && delta.way &&
                <sup>
                  <UI.Icon className={`info-price-delta-icon card-header-price-delta-icon-${delta.way}`} icon={`arrow-${delta.way}`} />
                </sup>
              }
            </h2>
            {/* <h6 className="property-price-secondary">
              <Price deals={this.props.property.deals} dealType={this.props.dealType} currency="RUB" />
            </h6> */}
            {/* <PriceDelta className="property-price-delta" delta={this.props.delta} /> */}
          </div>

          <div className="info-location">
            <strong>{location.placeData && location.placeData.route.name} ш., {location.mkadDistance} км</strong>
          </div>

          <div className="info-list">
            <UI.DL name="propertySize" type="dimension" value={property.objectProperty.area} className="dl-horizont" />
            <UI.DL name="landSize" type="dimension" value={property.landProperty.area} className="dl-horizont" />
            <UI.DL name="settlement" value={location.placeData && location.placeData.subLocality1 && location.placeData.subLocality1.name} className="dl-horizont" />
            <UI.DL name="id" value={property.id} className="dl-horizont info-list-item-id" />
          </div>

          <div className="info-request-modal">
            <RequestModal className="btn btn-success btn-xlg btn-block text-center text-weight-200 text-uppercase" text="Посмотреть дом" />
          </div>

          <div className="info-utils hidden-xs hidden-sm">
            {/* <div className="info-utils-container">
              <UI.Button size="xs" className="info-utils-btn">
                В избранное
                <UI.Icon className="info-utils-icon" icon="heart" />
              </UI.Button>
            </div>
            <div className="info-utils-container">
              <UI.Button size="xs" className="info-utils-btn">
                Распечатать
                <UI.Icon className="info-utils-icon" icon="print" />
              </UI.Button>
            </div> */}
            <div className="info-utils-container">
              <ShareModal />
              <UI.Icon className="info-utils-icon" icon="envelope" />
            </div>
          </div>
        </div>
      </UI.Panel>
    );
  }
}

export default PropertyInfo;
