Closed minotogna closed 1 month ago
import { Label } from './label' import { Table } from './table' import { CycleName } from './cycle' // exported from: meta/chart type PieChart = unknown type BarChart = unknown // exported from: meta/dashboard export enum DashboardItemType { table = 'table', pieChart = 'pieChart', barChart = 'barChart', } export type DashboardItem<Type = DashboardItemType> = { type: Type title: Label } export type DashboardTable = DashboardItem<DashboardItemType.table> & { table: Table } export type DashboardPieChart = DashboardItem<DashboardItemType.pieChart> & { chart: PieChart } export type DashboardBarChart = DashboardItem<DashboardItemType.barChart> & { chart: BarChart } // components/Dashboard const items : Array<DashboardItem> = [{}] <Dashboard items={items} /> const FRADashboard : Record<CycleName, Array<DashboardItem>> const FRA2020Dashboard = { .. } const FRA2025Dashboard = { .. }