import React from 'react';
import { Select } from '@grafana/ui';

function FormatSelect(props) {
  var _a;
  const onChangeFormat = (e) => {
    var _a2;
    props.onChange({
      ...props.query,
      format: e.value || 0
    });
    (_a2 = props.onRunQuery) == null ? void 0 : _a2.call(props);
  };
  return /* @__PURE__ */ React.createElement(
    Select,
    {
      "aria-label": "Format data frames as",
      id: (_a = props.id) != null ? _a : "formatAs",
      options: props.options,
      value: props.query.format,
      onChange: onChangeFormat,
      menuShouldPortal: true
    }
  );
}

export { FormatSelect };
//# sourceMappingURL=FormatSelect.js.map
