github.com/turbot/steampipe@v1.7.0-rc.0.0.20240517123944-7cef272d4458/ui/dashboard/src/components/dashboards/inputs/index.ts (about)

     1  import { getComponent } from "../index";
     2  import { IInput } from "./types";
     3  const Table = getComponent("table");
     4  
     5  const inputsMap = {};
     6  
     7  const getInputComponent = (key: string): IInput => inputsMap[key];
     8  
     9  const registerInputComponent = (key: string, component: IInput) => {
    10    inputsMap[key] = component;
    11  };
    12  
    13  const TableWrapper: IInput = {
    14    type: "table",
    15    component: Table,
    16  };
    17  
    18  registerInputComponent(TableWrapper.type, TableWrapper);
    19  
    20  export { getInputComponent, registerInputComponent };