feat: Add remove account button to health page UI

This commit is contained in:
Lukas May
2026-03-03 12:08:48 +01:00
parent 86c6ad8be1
commit 2f2ad6eb95
2 changed files with 39 additions and 3 deletions

View File

@@ -1,6 +1,7 @@
import { CheckCircle2, XCircle, AlertTriangle } from "lucide-react";
import { CheckCircle2, XCircle, AlertTriangle, Trash2 } from "lucide-react";
import { Card, CardContent } from "@/components/ui/card";
import { Badge } from "@/components/ui/badge";
import { Button } from "@/components/ui/button";
function formatResetTime(isoDate: string): string {
const now = Date.now();
@@ -92,7 +93,13 @@ export type AccountData = {
activeAgentCount: number;
};
export function AccountCard({ account }: { account: AccountData }) {
export function AccountCard({
account,
onDelete,
}: {
account: AccountData;
onDelete?: (e: React.MouseEvent) => void;
}) {
const hasWarning = account.credentialsValid && !account.isExhausted && account.error;
const statusIcon = !account.credentialsValid ? (
@@ -140,6 +147,16 @@ export function AccountCard({ account }: { account: AccountData }) {
<span>{statusText}</span>
</div>
</div>
{onDelete && (
<Button
variant="ghost"
size="icon"
className="shrink-0 text-muted-foreground hover:text-destructive"
onClick={onDelete}
>
<Trash2 className="h-4 w-4" />
</Button>
)}
</div>
{/* Usage bars */}