Refactored funnel report. Made BarChart more generic.

This commit is contained in:
Mike Cao 2023-05-24 21:40:02 -07:00
parent 050cd2f5d9
commit fb4dd75e18
24 changed files with 327 additions and 367 deletions

View file

@ -1,12 +1,17 @@
import DataTable from 'components/metrics/DataTable';
import { useMessages } from 'hooks';
export function FunnelTable({ ...props }) {
const { data } = props;
export function FunnelTable({ data }) {
const { formatMessage, labels } = useMessages();
const tableData =
data?.map(a => ({ x: a.x, y: a.y, z: Math.floor(a.y / data[0].y) * 100 })) || [];
return <DataTable data={tableData} title="Url" type="device" />;
return (
<DataTable
data={data}
title={formatMessage(labels.url)}
metric={formatMessage(labels.visitors)}
showPercentage={false}
/>
);
}
export default FunnelTable;