Toast after data export

This commit is contained in:
Gregory Schier
2024-05-14 00:36:15 -07:00
parent 0a98f08f2a
commit cbbc01a7c6
2 changed files with 25 additions and 6 deletions

View File

@@ -4,12 +4,14 @@ import { ExportDataDialog } from '../components/ExportDataDialog';
import { useActiveWorkspace } from './useActiveWorkspace';
import { useAlert } from './useAlert';
import { useWorkspaces } from './useWorkspaces';
import { useToast } from '../components/ToastContext';
export function useExportData() {
const workspaces = useWorkspaces();
const activeWorkspace = useActiveWorkspace();
const alert = useAlert();
const dialog = useDialog();
const toast = useToast();
return useMutation({
onError: (err: string) => {
@@ -28,6 +30,12 @@ export function useExportData() {
onHide={hide}
workspaces={workspaces}
activeWorkspace={activeWorkspace}
onSuccess={() => {
toast.show({
variant: 'success',
message: 'Data export successful',
});
}}
/>
),
});