import React, { ChangeEvent, FC } from 'react'; import { SelectableValue } from '@grafana/data'; import { InlineField, InlineFieldRow, Input, Select } from '@grafana/ui'; import { downsamplingTypes, ExpressionQuery, upsamplingTypes } from '../types'; interface Props { refIds: Array>; query: ExpressionQuery; labelWidth: number; onChange: (query: ExpressionQuery) => void; } export const Resample: FC = ({ labelWidth, onChange, refIds, query }) => { const downsampler = downsamplingTypes.find((o) => o.value === query.downsampler); const upsampler = upsamplingTypes.find((o) => o.value === query.upsampler); const onWindowChange = (event: ChangeEvent) => { onChange({ ...query, window: event.target.value }); }; const onRefIdChange = (value: SelectableValue) => { onChange({ ...query, expression: value.value }); }; const onSelectDownsampler = (value: SelectableValue) => { onChange({ ...query, downsampler: value.value }); }; const onSelectUpsampler = (value: SelectableValue) => { onChange({ ...query, upsampler: value.value }); }; return ( <> ); };