Alignments.tsx 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. import React, { SFC } from 'react';
  2. import _ from 'lodash';
  3. import { StackdriverPicker } from './StackdriverPicker';
  4. export interface Props {
  5. onChange: (metricDescriptor) => void;
  6. templateSrv: any;
  7. alignOptions: any[];
  8. metricDescriptor: {
  9. valueType: string;
  10. metricKind: string;
  11. };
  12. perSeriesAligner: string;
  13. }
  14. export const Alignments: SFC<Props> = ({ perSeriesAligner, templateSrv, onChange, alignOptions }) => {
  15. return (
  16. <React.Fragment>
  17. <div className="gf-form-group">
  18. <div className="gf-form offset-width-9">
  19. <label className="gf-form-label query-keyword width-15">Aligner</label>
  20. <StackdriverPicker
  21. onChange={value => onChange(value)}
  22. selected={perSeriesAligner}
  23. templateVariables={templateSrv.variables}
  24. options={alignOptions}
  25. searchable={true}
  26. placeholder="Select Alignment"
  27. className="width-15"
  28. groupName="Alignment Options"
  29. />
  30. </div>
  31. </div>
  32. </React.Fragment>
  33. );
  34. };