import React, { Component } from 'react';

import Select from 'react-select';
import constants from 'cem/constants/properties';
const { options } = constants;

import styles from 'cem/styles/id/main';
import UI from 'cem/components/ui';
const {
  Grid: { Col },
  Form: { Group, Label, Input },
  Grid,
} = UI;

export default class extends Component {
  render() {
    const { specification, information } = this.props.fields;
    return (
      <section className={this.props.className}>
        <Grid.Row>
          <Col xs="20">
            <h2 className={styles.title}>Описание квартиры</h2>
          </Col>
        </Grid.Row>

        <Grid.Row>
          <Col sm="10">
            <h3 className={styles.subTitle}>Описание помещения</h3>
            <Grid.Row>
              <Col sm="14" className={styles.wrapper}>
                <Grid.Row>
                  <Col sm="10">
                    <Group>
                      <Label>Свободная планировка</Label>
                      <Input type="checkbox" {...specification.isOpenLayout} />
                    </Group>
                  </Col>
                  <Col sm="10">
                    <Group>
                      <Label>Высота потолков, м</Label>
                      <Input block type="text" {...specification.ceilHeight} />
                    </Group>
                  </Col>
                </Grid.Row>
                <Grid.Row>
                  <Col sm="10">
                    <Group>
                      <Label>Общая площадь, м²</Label>
                      <Input block type="text" {...specification.totalArea} />
                    </Group>
                  </Col>
                  <Col sm="10">
                    <Group>
                      <Label>Жилая площадь, м²</Label>
                      <Input block type="text" {...specification.livingArea} />
                    </Group>
                  </Col>
                </Grid.Row>
                <Grid.Row>
                  <Col sm="10">
                    <Group>
                      <Label>Кол-во комнат</Label>
                      <Input block type="text" {...specification.roomsCount} />
                    </Group>
                  </Col>
                  <Col sm="10">
                    <Group>
                      <Label>Кол-во санузлов</Label>
                      <Input block type="text" {...specification.wcsCount} />
                    </Group>
                  </Col>
                </Grid.Row>
                <Grid.Row>
                  <Col sm="10">
                    <Group>
                      <Label>Балкон</Label>
                      <Input type="checkbox" {...specification.withBalcony} />
                    </Group>
                  </Col>
                  <Col sm="10">
                    <Group>
                      <Label>Лоджия</Label>
                      <Input type="checkbox" {...specification.withLoggia} />
                    </Group>
                  </Col>
                  <Col sm="10">
                    {specification.withBalcony.value && (
                      <Group>
                        <Label>Количество балконов</Label>
                        <Input block type="text" {...specification.balconyCount} />
                      </Group>
                    )}
                  </Col>
                  <Col sm="10">
                    {specification.withLoggia.value && (
                      <Group>
                        <Label>Количество лоджий</Label>
                        <Input block type="text" {...specification.loggiaCount} />
                      </Group>
                    )}
                  </Col>
                </Grid.Row>
                <Grid.Row>
                  <Col sm="10">
                    <Group className={styles.resetMargin}>
                      <Label>Этаж</Label>
                      <Input block type="text" {...specification.floor} />
                    </Group>
                  </Col>
                  <Col sm="10">
                    <Group className={styles.resetMargin}>
                      <Label>Окна во двор</Label>
                      <div className={styles.selectWrapper}>
                        <Select {...specification.windows} options={options.windowOverlook} valueKey="id" labelKey="title" onBlur={() => {}} />
                      </div>
                    </Group>
                  </Col>
                </Grid.Row>
              </Col>
            </Grid.Row>
          </Col>
          <Col sm="10">
            <h3 className={styles.subTitle}>Информация об объекте</h3>
            <Grid.Row>
              <Col sm="14" className={styles.wrapper}>
                <Grid.Row>
                  <Col sm="10">
                    <Group>
                      <Label>Состояние</Label>
                      <div className={styles.selectWrapper}>
                        <Select {...information.condition} options={options.condition} valueKey="id" labelKey="title" onBlur={() => {}} />
                      </div>
                    </Group>
                  </Col>
                </Grid.Row>
                <Grid.Row>
                  <Col sm="10">
                    <Group>
                      <Label>Ремонт</Label>
                      <div className={styles.selectWrapper}>
                        <Select {...information.renovate} options={options.renovate} valueKey="id" labelKey="title" onBlur={() => {}} />
                      </div>
                    </Group>
                  </Col>
                  <Col sm="10">
                    <Group>
                      <Label>Мебель</Label>
                      <div className={styles.selectWrapper}>
                        <Select {...information.furniture} options={options.furniture} valueKey="id" labelKey="title" onBlur={() => {}} />
                      </div>
                    </Group>
                  </Col>
                </Grid.Row>
                <Grid.Row>
                  <Col sm="10">
                    <Group className={styles.resetMargin}>
                      <Label>Кондиционирование</Label>
                      <div className={styles.selectWrapper}>
                        <Select {...information.conditioning} options={options.conditioning} valueKey="id" labelKey="title" onBlur={() => {}} />
                      </div>
                    </Group>
                  </Col>
                  <Col sm="10">
                    <Group className={styles.resetMargin}>
                      <Label>Вентиляция</Label>
                      <div className={styles.selectWrapper}>
                        <Select {...information.ventilation} options={options.ventilation} valueKey="id" labelKey="title" onBlur={() => {}} />
                      </div>
                    </Group>
                  </Col>
                </Grid.Row>
              </Col>
            </Grid.Row>
          </Col>
        </Grid.Row>
      </section>
    );
  }
}
