2024-06-25 19:43:47 +08:00
|
|
|
import * as React from 'react';
|
2022-04-22 21:33:13 +08:00
|
|
|
|
2022-03-31 15:36:04 +08:00
|
|
|
import { StandardEditorProps } from '@grafana/data';
|
2025-08-27 05:25:16 +08:00
|
|
|
import { selectors } from '@grafana/e2e-selectors';
|
2022-03-31 15:36:04 +08:00
|
|
|
import { Switch } from '@grafana/ui';
|
|
|
|
|
2025-08-27 05:25:16 +08:00
|
|
|
export function PaginationEditor({ onChange, value }: StandardEditorProps<boolean>) {
|
2022-03-31 15:36:04 +08:00
|
|
|
const changeValue = (event: React.FormEvent<HTMLInputElement> | undefined) => {
|
|
|
|
onChange(event?.currentTarget.checked);
|
|
|
|
};
|
|
|
|
|
2025-08-27 05:25:16 +08:00
|
|
|
return (
|
|
|
|
<Switch
|
|
|
|
label={selectors.components.PanelEditor.OptionsPane.fieldLabel(`Enable pagination`)}
|
|
|
|
value={Boolean(value)}
|
|
|
|
onChange={changeValue}
|
|
|
|
/>
|
|
|
|
);
|
2022-03-31 15:36:04 +08:00
|
|
|
}
|