import React from "react";
import { connect } from "redux-bundler-react";
import { SidebarButton } from "../../application-controls/index";
import QuestionModal from "./question-modal";

class questionsTab extends React.Component {
  constructor(props) {
    super(props);
    this.handleClick = this.handleClick.bind(this);
  }
  handleClick() {
    const { doModalOpen } = this.props;
    doModalOpen({
      children: [QuestionModal],
      options: {},
      openedBy: "questionsTab",
    });
  }
  render() {
    return (
      <SidebarButton
        iconClass="mdi mdi-help-circle"
        label="Contact Us"
        title="Contact Us"
        onClick={this.handleClick}
      />
    );
  }
}

export default connect(
  "doModalOpen",
  "doQuestionBarActivate",
  "selectQuestionsTabStatus",
  questionsTab
);
