Alignments.tsx 999 B

1234567891011121314151617181920212223242526272829303132
  1. import React, { FC } from 'react';
  2. import { MetricSelect } from 'app/core/components/Select/MetricSelect';
  3. import { TemplateSrv } from 'app/features/templating/template_srv';
  4. import { SelectableValue } from '@grafana/data';
  5. export interface Props {
  6. onChange: (perSeriesAligner: any) => void;
  7. templateSrv: TemplateSrv;
  8. alignOptions: Array<SelectableValue<string>>;
  9. perSeriesAligner: string;
  10. }
  11. export const Alignments: FC<Props> = ({ perSeriesAligner, templateSrv, onChange, alignOptions }) => {
  12. return (
  13. <>
  14. <div className="gf-form-group">
  15. <div className="gf-form offset-width-9">
  16. <label className="gf-form-label query-keyword width-15">Aligner</label>
  17. <MetricSelect
  18. onChange={onChange}
  19. value={perSeriesAligner}
  20. variables={templateSrv.variables}
  21. options={alignOptions}
  22. placeholder="Select Alignment"
  23. className="width-15"
  24. />
  25. </div>
  26. </div>
  27. </>
  28. );
  29. };