export default ({ activity }) => { const leftActivity = activity .filter(a => a.ch === "l") .map(a => a.endTime - a.startTime) .reduce((a, c) => a + c, 0); const rightActivity = activity .filter(a => a.ch === "r") .map(a => a.endTime - a.startTime) .reduce((a, c) => a + c, 0); return (
会話時間 (ms)
{leftActivity + rightActivity}
会話の割合
左{" "} {leftActivity / (leftActivity + rightActivity)} {" "} 右
); };