import { Component } from "react"; export default class extends Component { render() { const leftActivity = this.props.activity .filter(a => a.ch === "l") .map(a => a.endTime - a.startTime) .reduce((a, c) => a + c, 0); const rightActivity = this.props.activity .filter(a => a.ch === "r") .map(a => a.endTime - a.startTime) .reduce((a, c) => a + c, 0); return (