import React from 'react' ; import { i18n } from '@osd/i18n' ; import { VisOptionsProps } from 'src/plugins/vis_default_editor/public' ; import { SwitchOption } from './switch' ; import { SelectOption } from './select' ; interface BasicOptionsParams { addTooltip : boolean ; legendPosition : string ; } function BasicOptions < VisParams extends BasicOptionsParams > ( { stateParams , setValue , vis , } ) { return ( < > < SelectOption label = { i18n . translate ( 'charts.controls.vislibBasicOptions.legendPositionLabel' , { defaultMessage : 'Legend position' , } ) } options = { vis . type . editorConfig . collections . legendPositions } paramName = "legendPosition" value = { stateParams . legendPosition } setValue = { setValue } / > < SwitchOption label = { i18n . translate ( 'charts.controls.vislibBasicOptions.showTooltipLabel' , { defaultMessage : 'Show tooltip' , } ) } paramName = "addTooltip" value = { stateParams . addTooltip } setValue = { setValue } / > < />); } export { BasicOptions } ;