import React, { Component } from "react";
import { View } from "@tarojs/components";
import InterviewMyUser from "./myUser";
import InterviewOtherUser from "./otherUser";

class InterviewContent extends Component {
  constructor(props) {
    super(props);
    this.state = {
    }
  }

  handleCustomerPrev() {
    this.props.onPrevClick();
  }

  handleCustomerNext(resData) {
    this.props.onNextClick(resData);
  }

  render() {
    const { interviewIdx, customerList, uaiIdList, refreshInterview } = this.props;
    return (
      <View>
        { customerList[interviewIdx].myUser === 1 ? (
          <InterviewMyUser
            interviewIdx={interviewIdx}
            customerList={customerList}
            uaiIdList={uaiIdList}
            refreshInterview={refreshInterview}
            onPrevClick={this.handleCustomerPrev.bind(this)}
            onNextClick={this.handleCustomerNext.bind(this)}
          />
        ) : (
          <InterviewOtherUser
            interviewIdx={interviewIdx}
            customerList={customerList}
            uaiIdList={uaiIdList}
            refreshInterview={refreshInterview}
            onPrevClick={this.handleCustomerPrev.bind(this)}
            onNextClick={this.handleCustomerNext.bind(this)}
          />
        )}
      </View>
    )
  }
}

export default InterviewContent;
