import React from 'react';
import {observer, inject} from 'mobx-react';
import {DIALOG} from "../../../../stores/global_ui";
import NumberFormat from 'react-number-format';

@inject('appstate')
@observer
export default class CompletedOrder extends React.Component {

  constructor(props) {
    super(props);
    this.props = props;
    this.state = {};
    this.defaultState = Object.assign({}, this.state);

    this.http = props.appstate.http;
    this.order = props.appstate.order;
    this.globalUI = props.appstate.globalUI;
  }

  // makePayment() {
  //   this.http.post("payments/add_payment", {
  //     package_transaction_id: this.order.selectedOrder.id
  //   })
  //     .then(res => {
  //       this.order.getDetail(this.order.selectedOrder.id);
  //       this.globalUI.hideDialog(DIALOG.ORDER.MAKE_PAYMENT);
  //     })
  // }

  componentDidMount() {

    const {parent} = this.props;

    setTimeout(() => {
      parent.setState({
        handleNext: () => {return true}
      });
    }, 1000);
  }

  render() {
    return (
      <div>
        Your payment is already completed
      </div>
    )
  }
}
