File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
apps/frontend/src/lib/components/blocks/delete-record Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 77 import { createMutation , useQueryClient } from " @tanstack/svelte-query"
88 import { queryParam } from " sveltekit-search-params"
99 import { toast } from " svelte-sonner"
10+ import Button from " $lib/components/ui/button/button.svelte"
11+ import { Loader2Icon } from " lucide-svelte"
1012
1113 const deleteRecordId = queryParam (" deleteRecordId" )
1214
6163 >
6264 Cancel
6365 </AlertDialog .Cancel >
64- <AlertDialog .Action class ="text-background bg-red-500 hover:bg-red-600" on:click ={onDelete }>
65- Delete
66+ <AlertDialog .Action asChild >
67+ <Button on:click ={onDelete } variant ="destructive" disabled ={$deleteRecordMutation .isPending }>
68+ {#if $deleteRecordMutation .isPending }
69+ <Loader2Icon class =" mr-2 size-3 animate-spin" />
70+ {/if }
71+ Delete
72+ </Button >
6673 </AlertDialog .Action >
6774 </AlertDialog .Footer >
6875 </AlertDialog .Content >
You can’t perform that action at this time.
0 commit comments