import React, {FunctionComponent, CSSProperties} from 'react' import { GaugeLayerConfig, SizedConfig, TableGraphLayerConfig, LayerTypes, SimpleTableLayerConfig, } from '../types' import {GaugeLayer} from './Gauge' import {LatestValueTransform} from './LatestValueTransform' import {newTableFromConfig} from '../utils/newTable' import {RawFluxDataTable} from './RawFluxDataTable' import {FluxTablesTransform} from './FluxTablesTransform' import {TableGraphLayer} from './Table' import {SimpleTableLayer} from './SimpleTable' interface Props { config: SizedConfig } export const SizedTable: FunctionComponent = ({config, children}) => { const {width, height} = config config.showAxes = false const fullsizeStyle: CSSProperties = { position: 'absolute', top: 0, left: 0, right: 0, bottom: 0, } return (
{config.layers.map((layerConfig, layerIndex) => { switch (layerConfig.type) { case LayerTypes.Gauge: return ( {latestValue => ( )} ) case LayerTypes.RawFluxDataTable: return ( ) case LayerTypes.SimpleTable: { return ( ) } case LayerTypes.Table: return ( {tables => ( )} ) default: return null } })} {children && children}
) } SizedTable.displayName = 'SizedTable'