import React from 'react';
import {observer, inject} from 'mobx-react';
import bind from 'bind-decorator';
import {
  Card,
  CardActions,
  CardHeader,
  CardMedia,
  CardTitle,
  AutoComplete,
  CardText,
  FlatButton,
  Divider,
  RaisedButton,
  Toolbar,
  DatePicker,
  FontIcon,
  SelectField,
  MenuItem,
  ToolbarGroup,
  FloatingActionButton,
  ToolbarSeparator,
  IconButton,
  ToolbarTitle,
  RadioButton, RadioButtonGroup,
  Tabs, Tab, TextField, Dialog
} from 'material-ui';
import {withRouter} from 'react-router';
import {BrowserRouter as Router, Route} from 'react-router-dom';
import StarBorder from 'material-ui/svg-icons/toggle/star-border';
import ContentAdd from 'material-ui/svg-icons/content/add';

import '../style.scss';
import {appConfig} from "../../../config/app";

@inject('appstate')
@observer
export default class Confirmation extends React.Component {
  constructor(props) {
    super(props);
    this.props = props;
    this.state = {

    };
    this.defaultState = Object.assign({}, this.state);
    this.http = props.appstate.http;
    this.authStore = props.appstate.auth;
  }

  componentDidMount() {
    console.log('Profile loaded!');

  }

  render() {

    const data = {
        ka_name: 'ARS (U2)',
        ka_number: '1',
        class: 'Executive (A)',
        departureStation: 'MEDAN (MDN)',
        destinationStation: 'KUALA NAMU (KLN)',
        departureDate: '22 Sep 2017, 03:30',
        destinationDate: '22 Sep 2017, 04:00',
        adultPrice: '100000',
        childPrice: '100000',
        totalBuy: '2'
      };

    return (
      <Card className="animated fadeIn">
        <Toolbar className="toolbarCard" style={{backgroundColor: '#fff'}}>
          <ToolbarGroup>
                <IconButton
                  iconClassName="material-icons"
                  tooltip="Back"
                  style={{marginLeft:'0px'}}
                  onClick={this.props.onClickBack}
                >
                  arrow_back
                </IconButton>
            <ToolbarTitle style={{fontSize: 14, fontWeight: 500, color: '#32325d'}} text="Confirmation"/>
          </ToolbarGroup>
        </Toolbar>
        <Divider/>
          <div style={{padding: '14px'}}>
            <div className="row hover">
              <div className="col l3">
                <p>Railink Name</p>
              </div>
              <div className="col l1">
                <p>:</p>
              </div>
              <div className="col l8">
                <p>{data.ka_name}</p>
              </div>
            </div>
            <div className="row hover">
              <div className="col l3">
                <p>Class</p>
              </div>
              <div className="col l1">
                <p>:</p>
              </div>
              <div className="col l8">
                <p>{data.class}</p>
              </div>
            </div>
            <div className="row hover">
              <div className="col l3">
                <p>Departure Station</p>
              </div>
              <div className="col l1">
                <p>:</p>
              </div>
              <div className="col l8">
                <p>{data.departureStation}</p>
              </div>
            </div>
            <div className="row hover">
              <div className="col l3">
                <p>Destination Station</p>
              </div>
              <div className="col l1">
                <p>:</p>
              </div>
              <div className="col l8">
                <p>{data.destinationStation}</p>
              </div>
            </div>
            <div className="row hover">
              <div className="col l3">
                <p>Departure Date</p>
              </div>
              <div className="col l1">
                <p>:</p>
              </div>
              <div className="col l8">
                <p>{data.departureDate}</p>
              </div>
            </div>
            <div className="row hover">
              <div className="col l3">
                <p>Destination Date</p>
              </div>
              <div className="col l1">
                <p>:</p>
              </div>
              <div className="col l8">
                <p>{data.destinationDate}</p>
              </div>
            </div>
            <div className="row hover">
              <div className="col l4">
                <p style={{fontWeight: 'bolder'}}>Ticket Price</p>
              </div>
            </div>
            <div className="row hover">
              <div className="col l3">
                <p>Adult</p>
              </div>
              <div className="col l1">
                <p>:</p>
              </div>
              <div className="col l8">
                <p>Rp. {data.adultPrice} x {data.totalBuy} {(data.totalBuy > 1) ? <span>Passengers</span> : <span>Passenger</span>}</p>
              </div>
            </div>
            <div className="row hover">
              <div className="col l3">
                <p>Child</p>
              </div>
              <div className="col l1">
                <p>:</p>
              </div>
              <div className="col l8">
                <p>Rp. {data.childPrice} x {data.totalBuy} {(data.totalBuy > 1) ? <span>Passengers</span> : <span>Passenger</span>}</p>
              </div>
            </div>
            <div className="row hover">
              <div className="col l3">
                <p style={{fontWeight: 'bolder'}}>Total</p>
              </div>
              <div className="col l1">
                <p>:</p>
              </div>
              <div className="col l8">
                <p>Rp. {Number(data.adultPrice + data.childPrice)}</p>
              </div>
            </div>
            <div className="row">
              <div className="col l12">
                <blockquote>
                  <p style={{fontWeight: 'bolder'}}>Warning</p>
                  <br />
                  The above price does not include the admin fee.
                </blockquote>
              </div>
            </div>
            <div className="row">
              <div className="col m10" />
              <div className="col m2">
                <RaisedButton label="Confirm" primary={true} style={{marginTop: '30px'}} icon={ <FontIcon className="material-icons">check</FontIcon>} />
              </div>
            </div>
          </div>
      </Card>
    )
  }
}
