import React from 'react'; import { PropTypes } from 'prop-types'; import Parser from 'html-react-parser'; import Modal from '../../modal'; import './style.scss'; const SingleInterview = props => (
{ props.activeSingleInterviewId.toString().padStart(3, '0') }
{ Parser(props.selectedInterview.name) }
{ props.selectedInterview.interview.filter(interview => interview.answer !== null) .map((interview, index) => { const question = props.questions.find(q => q.id === interview.question); return (

{index + 1}) { question.text }

{ Parser(interview.answer) }
); }) }
); SingleInterview.propTypes = { activeSingleInterviewId: PropTypes.number.isRequired, selectedInterview: PropTypes.shape({ name: PropTypes.string.isRequired, interview: PropTypes.array.isRequired, }).isRequired, toggleSingleInterview: PropTypes.func.isRequired, questions: PropTypes.arrayOf(PropTypes.shape({ id: PropTypes.string.isRequired, text: PropTypes.string.isRequired, })).isRequired, }; export default SingleInterview;