mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
33 lines
845 B
TypeScript
33 lines
845 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 = ({
|
|
hasMore,
|
|
canCompare,
|
|
getVersions,
|
|
getDiff,
|
|
isLastPage,
|
|
}: VersionsButtonsType) => (
|
|
<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>
|
|
);
|