import { useContext } from 'react'; import { GridTable, GridColumn } from 'react-basics'; import { useFormat, useMessages } from 'hooks'; import { ReportContext } from '../Report'; export function InsightsTable() { const { report } = useContext(ReportContext); const { formatMessage, labels } = useMessages(); const { groups = [] } = report?.parameters || {}; const { formatValue } = useFormat(); return ( {groups.map(({ name, label }) => { return ( {row => formatValue(row[name], name)} ); })} {row => row.views.toLocaleString()} {row => row.views.toLocaleString()} ); } export default InsightsTable;