// Libraries import React, { PureComponent } from 'react'; // Components import { FormLabel, Select, PanelOptionsGroup, SelectOptionItem } from '@grafana/ui'; // Types import { SingleStatOptions } from './types'; const labelWidth = 6; export interface Props { options: SingleStatOptions; onChange: (options: SingleStatOptions) => void; } const percents = ['20%', '30%', '50%', '70%', '80%', '100%', '110%', '120%', '150%', '170%', '200%']; const fontSizeOptions = percents.map(v => { return { value: v, label: v }; }); export class FontSizeEditor extends PureComponent { setPrefixFontSize = (v: SelectOptionItem) => this.props.onChange({ ...this.props.options, prefixFontSize: v.value }); setValueFontSize = (v: SelectOptionItem) => this.props.onChange({ ...this.props.options, valueFontSize: v.value }); setPostfixFontSize = (v: SelectOptionItem) => this.props.onChange({ ...this.props.options, postfixFontSize: v.value }); render() { const { prefixFontSize, valueFontSize, postfixFontSize } = this.props.options; return (
Prefix option.value === valueFontSize)} />
Postfix