import React from 'react';
import '../AllQuestions.css';
import { Layout } from 'antd';
import 'antd/dist/antd.css';
import Selector from '../Selector';
import QuestionTable from './QuestionTable';
import { authenticationService } from '../../../_services';
import { Siderc } from '../../Main/Siderc';
import { Headerc } from '../../Main/Headerc';
// import { ReactComponent } from '*.svg';



class Draft extends React.Component{
 
  state = {
    currentUser: authenticationService.currentUserValue,
    top: 'topLeft',
    bottom: 'bottomRight',
    classes: "1" ,
    subject: "",
    category:"",
    questionType:"",
    complexity:""
  };

  callbackFunction = (childData) => {
    // console.log("Parent recieved Selector Data: "+ childData);
    this.setState({
     classes: childData.classes ,
     module_id: childData.module_id,
     module: childData.module,
     questionType: childData.questionType,
     complexity: childData.complexity,
   });
}
  
  render(){
    return(
      <Layout>
          <Siderc />
          <Layout style={{}}>
            <Headerc />
                <Layout>
                  <Layout className="SubSection2">
                    <Selector page = "myQuestions" parentCallback = {this.callbackFunction}/>
                      <Layout className="SubSection2">
                        <div style={{padding:'5px'}}>
                        <QuestionTable selectorState ={this.state}/>
                        </div>
                      </Layout>
                  </Layout>
              </Layout>
          </Layout>
      </Layout>
    )
  };
};

export default Draft;



