Connect to Lovable Cloud

Implement monitoring and alert-resolve UI improvements:
- Enhance useAlertGroupActions with robust error handling and breadcrumb logging
- Add loading state visuals to GroupedAlertsPanel and Resolve All button
- Integrate loading indicator (Loader2) for better user feedback during resolves
This commit is contained in:
gpt-engineer-app[bot]
2025-11-11 13:21:58 +00:00
parent 0dfc5ff724
commit 2093560f64
3 changed files with 86 additions and 9 deletions

View File

@@ -1,7 +1,7 @@
import { useState } from 'react';
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card';
import { Button } from '@/components/ui/button';
import { AlertCircle, AlertTriangle, Info, ChevronDown, ChevronUp, Clock, Zap, RefreshCw } from 'lucide-react';
import { AlertCircle, AlertTriangle, Info, ChevronDown, ChevronUp, Clock, Zap, RefreshCw, Loader2 } from 'lucide-react';
import { formatDistanceToNow } from 'date-fns';
import type { GroupedAlert } from '@/hooks/admin/useGroupedAlerts';
import { useResolveAlertGroup, useSnoozeAlertGroup } from '@/hooks/admin/useAlertGroupActions';
@@ -211,7 +211,14 @@ export function GroupedAlertsPanel({ alerts, isLoading }: GroupedAlertsPanelProp
onClick={() => handleResolveGroup(alert)}
disabled={resolveGroup.isPending}
>
Resolve All
{resolveGroup.isPending ? (
<>
<Loader2 className="h-4 w-4 mr-2 animate-spin" />
Resolving...
</>
) : (
'Resolve All'
)}
</Button>
</div>
</div>