import ExpandMoreIcon from '@material-ui/icons/ExpandMore'; import ExpansionPanel from '@material-ui/core/ExpansionPanel'; import ExpansionPanelDetails from '@material-ui/core/ExpansionPanelDetails'; import ExpansionPanelSummary from '@material-ui/core/ExpansionPanelSummary'; import PropTypes from 'prop-types'; import React from 'react'; import { withStyles } from '@material-ui/core/styles'; const styles = theme => ({ root: { width: '100%', }, heading: { fontSize: theme.typography.pxToRem(15), flexBasis: '33.33%', flexShrink: 0, }, secondaryHeading: { fontSize: theme.typography.pxToRem(15), color: theme.palette.text.secondary, }, }); class Accordion extends React.Component { state = { expanded: this.props.defaultOpenPanel || null, }; handlePanelSelect = panel => (_event, expanded) => { this.setState({ expanded: expanded ? panel : false, }); if (expanded) { this.props.onChange(panel); } }; render() { const { classes, panels } = this.props; const { expanded } = this.state; return (