Alignments.tsx 987 B

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