Refactored teams components.

This commit is contained in:
Mike Cao 2023-10-07 22:42:49 -07:00
parent 6253d55790
commit 8b48130d5f
18 changed files with 75 additions and 44 deletions

View file

@ -6,7 +6,9 @@ import { useMessages, useLocale } from 'components/hooks';
import { formatDate } from 'lib/date';
import styles from './RetentionTable.module.css';
export function RetentionTable() {
const DAYS = [1, 2, 3, 4, 5, 6, 7, 14, 21, 28];
export function RetentionTable({ days = DAYS }) {
const { formatMessage, labels } = useMessages();
const { locale } = useLocale();
const { report } = useContext(ReportContext);
@ -16,8 +18,6 @@ export function RetentionTable() {
return <EmptyPlaceholder />;
}
const days = [1, 2, 3, 4, 5, 6, 7, 14, 21, 28];
const rows = data.reduce((arr, row) => {
const { date, visitors, day } = row;
if (day === 0) {