refactor(dashboard): the chart component is now cleaned up and easier to extend

This commit is contained in:
Carl-Gerhard Lindesvärd
2024-09-12 09:30:48 +02:00
parent 3e19f90e51
commit 558761ca9d
76 changed files with 2910 additions and 2475 deletions

View File

@@ -2,13 +2,13 @@ import { parseAsStringEnum, useQueryState } from 'nuqs';
import { mapKeys } from '@openpanel/validation';
import type { IChartRoot } from '../report/chart';
import type { ReportChartProps } from '../report-chart/context';
export function useOverviewWidget<T extends string>(
key: string,
widgets: Record<
T,
{ title: string; btn: string; chart: IChartRoot; hide?: boolean }
{ title: string; btn: string; chart: ReportChartProps; hide?: boolean }
>
) {
const keys = Object.keys(widgets) as T[];