style: format code with prettier
Local Build and Deploy / deploy (push) Successful in 49s

This commit is contained in:
openhands committed 2026-07-12 21:07:34 +02:00
1 parent e85e4d74ea
commit 2e4ed76121
378 files changed
+22404 -20686

No files matched your search

+22 -32
View File
@@ -1,55 +1,45 @@
'use client'
"use client";
import { RefreshCw } from 'lucide-react'
import { useEffect, useState } from 'react'
import { Badge } from '@/components/ui/badge'
import { Button } from '@/components/ui/button'
import { RefreshCw } from "lucide-react";
import { useEffect, useState } from "react";
import { Badge } from "@/components/ui/badge";
import { Button } from "@/components/ui/button";
export function HealthCheckClient() {
const [status, setStatus] = useState<'checking' | 'online' | 'offline'>('checking')
const [checking, setChecking] = useState(false)
const [status, setStatus] = useState<"checking" | "online" | "offline">("checking");
const [checking, setChecking] = useState(false);
async function checkEmulator() {
setChecking(true)
setStatus('checking')
setChecking(true);
setStatus("checking");
try {
const res = await fetch('/api/admin/devops/health')
const res = await fetch("/api/admin/devops/health");
if (res.ok) {
const data = await res.json()
setStatus(data.emulator ? 'online' : 'offline')
const data = await res.json();
setStatus(data.emulator ? "online" : "offline");
} else {
setStatus('offline')
setStatus("offline");
}
} catch {
setStatus('offline')
setStatus("offline");
} finally {
setChecking(false)
setChecking(false);
}
}
// biome-ignore lint/correctness/useExhaustiveDependencies: explicitly chosen here, see surrounding code
useEffect(() => {
checkEmulator()
}, [])
checkEmulator();
}, []);
return (
<div className="flex items-center gap-2">
<Badge
variant={
status === 'online' ? 'default' : status === 'offline' ? 'destructive' : 'secondary'
}
>
{status === 'checking' ? 'Checking...' : status === 'online' ? 'Online' : 'Offline'}
<Badge variant={status === "online" ? "default" : status === "offline" ? "destructive" : "secondary"}>
{status === "checking" ? "Checking..." : status === "online" ? "Online" : "Offline"}
</Badge>
<Button
variant="ghost"
size="icon"
className="h-6 w-6"
onClick={checkEmulator}
disabled={checking}
>
<RefreshCw className={`h-3 w-3 ${checking ? 'animate-spin' : ''}`} />
<Button variant="ghost" size="icon" className="h-6 w-6" onClick={checkEmulator} disabled={checking}>
<RefreshCw className={`h-3 w-3 ${checking ? "animate-spin" : ""}`} />
</Button>
</div>
)
);
}