feat: Add remove account button to health page UI
This commit is contained in:
@@ -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 */}
|
||||
|
||||
Reference in New Issue
Block a user