"use client"; import { useHealth, useConfig, useSessions } from "@/lib/hooks"; import { AlertTriangle } from "lucide-react"; export function StatusCard() { const { data: health, isError: healthError } = useHealth(); const { data: config } = useConfig(); const { data: sessions } = useSessions(10); const online = health?.status === "ok"; const model = config?.model || "—"; const activeSessions = sessions?.items?.filter((s) => !s.ended_at).length || 0; if (healthError) { return (
WebAPI Unreachable
Check that hermes-webapi is running on port 8643
); } return (
{model}
{activeSessions > 0 && (
{activeSessions} active session{activeSessions !== 1 ? "s" : ""}
)}
{online ? "Online" : "Offline"}
); }