PaginationEditor.tsx 505 B

123456789101112131415
  1. import React from 'react';
  2. import { StandardEditorProps } from '@grafana/data';
  3. import { Switch } from '@grafana/ui';
  4. export function PaginationEditor({ onChange, value, context }: StandardEditorProps<boolean>) {
  5. const changeValue = (event: React.FormEvent<HTMLInputElement> | undefined) => {
  6. if (event?.currentTarget.checked) {
  7. context.options.footer.show = false;
  8. }
  9. onChange(event?.currentTarget.checked);
  10. };
  11. return <Switch value={Boolean(value)} onChange={changeValue} />;
  12. }