import PropTypes from 'prop-types';
import { PureComponent } from 'react';
import { FormattedMessage, FormattedNumber, FormattedDate } from 'react-intl';
import classNames from 'classnames';
import api from 'mastodon/api';
import { roundTo10 } from 'mastodon/utils/numbers';
const dateForCohort = cohort => {
  const timeZone = 'UTC';
  switch(cohort.frequency) {
  case 'day':
    return 
|  | {data[0].data.slice(1).map((retention, i) => ( | ))}
                    {i + 1}
                   | 
|---|---|---|
|  | {data[0].data.slice(1).map((retention, i) => {
                const average = data.reduce((sum, cohort, k) => cohort.data[i + 1] ? sum + (cohort.data[i + 1].rate - sum)/(k + 1) : sum, 0);
                return ( | );
              })} | 
| 
                    {dateForCohort(cohort)}
                   | {cohort.data.slice(1).map(retention => ( | ))} |