Alignments.tsx 870 B

12345678910111213141516171819202122232425262728293031
  1. import React, { SFC } from 'react';
  2. import _ from 'lodash';
  3. import { MetricSelect } from 'app/core/components/Select/MetricSelect';
  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. <>
  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. <MetricSelect
  17. onChange={onChange}
  18. value={perSeriesAligner}
  19. variables={templateSrv.variables}
  20. options={alignOptions}
  21. placeholder="Select Alignment"
  22. className="width-15"
  23. />
  24. </div>
  25. </div>
  26. </>
  27. );
  28. };