
import React, { Component } from "react";
import OrderForm from './order_form'
class New extends Component {

  constructor(props){
    super(props);
    this.state = {
      type : undefined,
    }
  }
  
  componentDidMount = () => {
    const searchParams = new URLSearchParams(this.props.location.search.substring(1));
    this.setState({
      type : searchParams.get("type"),
    })
  }
  render() {
    return (
      <OrderForm form_type={this.state.type ? this.state.type : "new"} {...this.props}></OrderForm>
    )
  }
}
export default New;
