import React from 'react';
import { Layout } from 'antd';
import 'antd/dist/antd.css';
import Selector from './Selector';
import QuestionTable from './QuestionTable';
import { authenticationService } from '../../_services';

import './AllQuestions.css';
// import { Siderc } from '../Main/Siderc';
// import { Headerc } from '../Main/Headerc';



class AllQuestions 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>

				<Layout className="all-questions-section">
					<Selector page="allQuestions" parentCallback={this.callbackFunction} />
					<Layout className="list-questions-section">
						<div>
							<QuestionTable selectorState={this.state} />
						</div>
					</Layout>
				</Layout>

			</Layout>
		)
	};
};

export default AllQuestions;
