mirror of
https://github.com/grafana/grafana.git
synced 2025-09-29 02:54:02 +08:00

* Update DashboardPermissions.tsx * Update DashboardRow.tsx * Update AutoRefreshIntervals.tsx * Update JsonEditorSettings.tsx * ui updates * Update FolderPickerCtrl.ts * Update LinkSettingsEdit.tsx * Update LinkSettingsHeader.tsx * Update LinkSettingsList.tsx * Update actions.ts * Update AngularPanelOptions.tsx * Update getFieldOverrideElements.tsx * Update OptionsPaneOptions.tsx * Update types.ts * Update usePanelLatestData.ts * Update VisualizationButton.tsx * Update RowOptionsModal.tsx * Update SaveDashboardAsForm.tsx * Update SaveDashboardForm.tsx * Update SaveProvisionedDashboardForm.tsx * Update SaveDashboardErrorProxy.tsx * text edits * Update ShareSnapshot.tsx * Update PanelTypeCard.tsx * Update TransformationsEditor.tsx * Update panel.test.ts * text edits * Update DashboardSrv.ts * Update VersionHistoryButtons.tsx * Update DiffViewer.tsx * Update VersionHistoryTable.tsx * Update DashboardGrid.tsx * Update DashboardPanel.tsx * Update PanelPluginError.tsx * Update DashboardMigrator.ts
31 lines
843 B
TypeScript
31 lines
843 B
TypeScript
import React from 'react';
|
|
import { HorizontalGroup, 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,
|
|
}) => (
|
|
<HorizontalGroup>
|
|
{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>
|
|
</HorizontalGroup>
|
|
);
|