import * as React from "react" ; import { SENSOR_LIST } from "../../constants" ; import { ISensorProps , ISliderProps } from "../../viewUtils" ; import InputSlider from "./InputSlider" ; interface IProps { axisProperties : ISensorProps ; axisValues : { [ key ] : number ; } ; onUpdateValue : ( sensor : SENSOR_LIST , value : number ) => void ; } export const GenericSliderComponent = props => { return ( < div className = "generic-slider-component" > { props . axisProperties . sliderProps . map ( ( sliderProperties , index ) => { return ( < React . Fragment key = { index } > < InputSlider minValue = { sliderProperties . minValue } maxValue = { sliderProperties . maxValue } type = { sliderProperties . type } minLabel = { sliderProperties . minLabel } maxLabel = { sliderProperties . maxLabel } axisLabel = { sliderProperties . axisLabel } onUpdateValue = { props . onUpdateValue } value = { props . axisValues [ sliderProperties . axisLabel ] } step = { sliderProperties . step } / > < br /> < /React.Fragment>); } ) } < /div>); } ;