fix(databases): improve rebuild database button loading state

This commit is contained in:
Mauricio Siu
2025-03-08 20:17:46 -06:00
parent 00fc1a9c96
commit 4730845a40

View File

@@ -71,6 +71,7 @@ export const RebuildDatabase = ({ id, type }: Props) => {
<AlertDialog> <AlertDialog>
<AlertDialogTrigger asChild> <AlertDialogTrigger asChild>
<Button <Button
isLoading={isLoading}
variant="outline" variant="outline"
className="w-full border-destructive/50 hover:bg-destructive/10 hover:text-destructive text-destructive" className="w-full border-destructive/50 hover:bg-destructive/10 hover:text-destructive text-destructive"
> >
@@ -102,9 +103,11 @@ export const RebuildDatabase = ({ id, type }: Props) => {
<AlertDialogAction <AlertDialogAction
onClick={handleRebuild} onClick={handleRebuild}
className="bg-destructive text-destructive-foreground hover:bg-destructive/90" className="bg-destructive text-destructive-foreground hover:bg-destructive/90"
disabled={isLoading} asChild
> >
{isLoading ? "Rebuilding..." : "Yes, rebuild database"} <Button isLoading={isLoading} type="submit">
Yes, rebuild database
</Button>
</AlertDialogAction> </AlertDialogAction>
</AlertDialogFooter> </AlertDialogFooter>
</AlertDialogContent> </AlertDialogContent>