github.com/turbot/steampipe@v1.7.0-rc.0.0.20240517123944-7cef272d4458/ui/dashboard/src/components/dashboards/hierarchies/index.ts (about) 1 import { getComponent } from "../index"; 2 import { IHierarchy } from "./types"; 3 const Table = getComponent("table"); 4 5 const hierarchiesMap = {}; 6 7 const getHierarchyComponent = (key: string): IHierarchy => hierarchiesMap[key]; 8 9 const registerHierarchyComponent = (key: string, component: IHierarchy) => { 10 hierarchiesMap[key] = component; 11 }; 12 13 const TableWrapper: IHierarchy = { 14 type: "table", 15 component: Table, 16 }; 17 18 registerHierarchyComponent(TableWrapper.type, TableWrapper); 19 20 export { getHierarchyComponent, registerHierarchyComponent };