refactor(dashboard): the chart component is now cleaned up and easier to extend
This commit is contained in:
@@ -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[];
|
||||
|
||||
Reference in New Issue
Block a user