import React from 'react'; import { PropTypes } from 'prop-types'; import Parser from 'html-react-parser'; import Modal from '../../modal'; import getConfig from 'next/config'; import './style.scss'; const { publicRuntimeConfig } = getConfig(); class InterviewsList extends React.Component { constructor(props) { super(props); this.state = { activeLetter: 'A', }; } render() { const { activeLetter } = this.state; // Sort interviews alphabetically const sortedInterviews = this.props.data.sort((a, b) => a.name.localeCompare(b.name)); const interviews = {}; // Build up interviews object with letter key sortedInterviews.forEach((interview) => { const firstLetter = interview.name.charAt(0); if (typeof interviews[firstLetter] === 'undefined') { interviews[firstLetter] = []; } interviews[firstLetter].push(interview); }); return (