diff --git a/public/app/features/manage-dashboards/components/SnapshotListTable.tsx b/public/app/features/manage-dashboards/components/SnapshotListTable.tsx index d909eba9e82..37e1d7d03c3 100644 --- a/public/app/features/manage-dashboards/components/SnapshotListTable.tsx +++ b/public/app/features/manage-dashboards/components/SnapshotListTable.tsx @@ -2,10 +2,12 @@ import React, { useState, useCallback } from 'react'; import useAsync from 'react-use/lib/useAsync'; import { config } from '@grafana/runtime'; -import { ConfirmModal, Button, LinkButton } from '@grafana/ui'; +import { ConfirmModal } from '@grafana/ui'; import { Trans } from 'app/core/internationalization'; import { getDashboardSnapshotSrv, Snapshot } from 'app/features/dashboard/services/SnapshotSrv'; +import { SnapshotListTableRow } from './SnapshotListTableRow'; + export function getSnapshots() { return getDashboardSnapshotSrv() .getSnapshots() @@ -18,9 +20,12 @@ export function getSnapshots() { } export const SnapshotListTable = () => { const [snapshots, setSnapshots] = useState([]); + const [isFetching, setIsFetching] = useState(false); const [removeSnapshot, setRemoveSnapshot] = useState(); useAsync(async () => { + setIsFetching(true); const response = await getSnapshots(); + setIsFetching(false); setSnapshots(response); }, [setSnapshots]); @@ -58,34 +63,21 @@ export const SnapshotListTable = () => { - {snapshots.map((snapshot) => { - const url = snapshot.externalUrl || snapshot.url; - return ( - - - {snapshot.name} - - - {url} - - - {snapshot.external && ( - - External - - )} - - - - View - - - -