// eslint-disable-next-line no-unused-vars
class MaterialsContainer extends React.Component {
constructor(props) {
super(props);
this.state = {bExpanded: false, activeTab: 0};
this.toggleView = this.handleToggleView.bind(this);
this.switchMaterial = this.handleSwitchMaterial.bind(this);
this.trackOperation = this.trackOp.bind(this, '');
this.trackOperationCollapsed = this.trackOp.bind(this, 'Collapsed');
}
handleSwitchMaterial(idx) {
this.notifyHeap('Material Switched', idx - 1);
}
handleToggleView(newState, idx = 0) {
this.setState({bExpanded: newState, activeTab: idx});
const event = `Material ${newState ? 'Expanded' : 'Collapsed'}`;
this.notifyHeap(event, idx);
}
notifyHeap(event, idx) {
let data = {
material_id: this.props.data[idx].id,
material_pdf: this.props.data[idx].pdf,
material_title: this.props.data[idx].title
};
data = _.extend(data, this.props.activity, this.props.lesson);
heapTrack(event, data);
}
renderTab(m, idx) {
return (