mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
* Revert: QueryEditor components from grafana-ui * Use local version of experimental * Use experimental for query editor components * Fix type issues in MSSQL * point to actual version of experimental package * point to latest version of experimental Co-authored-by: Erik Sundell <erik.sundell87@gmail.com>
33 lines
855 B
TypeScript
33 lines
855 B
TypeScript
import React from 'react';
|
|
|
|
import { Stack } from '@grafana/experimental';
|
|
import { Tooltip, Button } from '@grafana/ui';
|
|
|
|
type VersionsButtonsType = {
|
|
hasMore: boolean;
|
|
canCompare: boolean;
|
|
getVersions: (append: boolean) => void;
|
|
getDiff: () => void;
|
|
isLastPage: boolean;
|
|
};
|
|
export const VersionsHistoryButtons: React.FC<VersionsButtonsType> = ({
|
|
hasMore,
|
|
canCompare,
|
|
getVersions,
|
|
getDiff,
|
|
isLastPage,
|
|
}) => (
|
|
<Stack>
|
|
{hasMore && (
|
|
<Button type="button" onClick={() => getVersions(true)} variant="secondary" disabled={isLastPage}>
|
|
Show more versions
|
|
</Button>
|
|
)}
|
|
<Tooltip content="Select two versions to start comparing" placement="bottom">
|
|
<Button type="button" disabled={!canCompare} onClick={getDiff} icon="code-branch">
|
|
Compare versions
|
|
</Button>
|
|
</Tooltip>
|
|
</Stack>
|
|
);
|