openforis / fra-platform

7 stars 6 forks source link

Dashboard FRA 2025 #3645

Closed minotogna closed 1 month ago

minotogna commented 6 months 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 = { .. }
minotogna commented 4 months ago