{"size": 2635, "ext": "js", "max_stars_repo_path": "src/client/components/Flight/index.js", "max_stars_repo_name": "drei01/flight-alerts", "max_stars_repo_stars_event_min_datetime": "2020-05-16T05:32:09.000Z", "max_stars_repo_stars_event_max_datetime": "2020-05-16T05:32:09.000Z", "max_issues_repo_path": "src/client/components/Flight/index.js", "max_issues_repo_name": "drei01/flight-alerts", "max_issues_repo_issues_event_min_datetime": "2019-11-22T18:25:15.000Z", "max_issues_repo_issues_event_max_datetime": "2021-10-18T20:54:00.000Z", "max_forks_repo_path": "src/client/components/Flight/index.js", "max_forks_repo_name": "drei01/flight-alerts", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": 2, "max_forks_count": null, "avg_line_length": 37.6428571429, "max_line_length": 110, "alphanum_fraction": 0.4387096774}
import React from 'react';
import c from 'classnames';
import styles from '../../style.less';
import {Row, Col} from 'react-bootstrap';
import DateTime from './DateTime';
import BookButton from './BookButton';
import Route from './Route';

export default ({flight}) => {
  const {airline} = flight;
  return (
    <div
      className={c(
        styles['theme-search-results-item'],
        styles['theme-search-results-item-rounded'],
        styles['theme-search-results-item-']
      )}
    >
      <div className={styles['theme-search-results-item-preview']}>
        <Row>
          <Col md={10}>
            <div className={styles['theme-search-results-item-flight-sections']}>
              <div className={styles['theme-search-results-item-flight-section']}>
                <Row className={styles['row row-no-gutter row-eq-height']}>
                  <Col md={2}>{flight.departure.format('MMM DD')}</Col>
                  <Col md={10}>
                    <div className={styles['theme-search-results-item-flight-section-item']}>
                      {flight.route.map((route) => (
                        <Row key={route.flight_no}>
                          <Col md={3}>
                            <DateTime date={route.departure} place={route.cityFrom} />
                          </Col>
                          <Col md={6}>
                            <Route route={route} duration={flight.fly_duration} />
                          </Col>
                          <Col md={3}>
                            <DateTime date={route.arrival} place={route.cityTo} />
                          </Col>
                        </Row>
                      ))}
                    </div>
                  </Col>
                </Row>
                <Row>
                  <Col md={2}>
                    <h5 className={styles['theme-search-results-item-flight-section-airline-title']}>
                      <img
                        className={styles['theme-search-results-item-flight-section-airline-logo']}
                        src={airline.logo}
                        alt={airline.name}
                        title={airline.name}
                      />{' '}
                      Operated by {airline.name}
                    </h5>
                  </Col>
                  <Col md={2} />
                  <Col md={8} />
                </Row>
              </div>
            </div>
          </Col>
          <Col md={2}>
            <BookButton price={flight.price} currencySymbol={flight.currencySymbol} link={flight.deep_link} />
          </Col>
        </Row>
      </div>
    </div>
  );
};
