import { ExternalLink, Play, RefreshCw, Server, Square, Terminal } from "lucide-react" import { Link } from "react-router-dom" import type { ServiceSummary, HealthStatus } from "@/types" import { useServiceAction } from "@/services/api/hooks" import { launcherLabel, subdomainUrl } from "@/lib/labels" import { HealthBadge } from "./HealthBadge" import { StackBadge } from "./StackBadge" interface ServiceCardProps { service: ServiceSummary health?: HealthStatus } export function ServiceCard({ service, health }: ServiceCardProps) { const hasHttp = service.port != null const { mutate, isPending } = useServiceAction() const doAction = (action: string) => { mutate({ name: service.id, action }) } const isDown = health?.status === "down" return (
{service.id} {health ? ( ) : hasHttp ? ( ) : null}
{service.description && (

{service.description}

)}
{service.port && ( :{service.port} )} {service.launcher && ( {launcherLabel(service.launcher)} )} {service.subdomain && ( {service.subdomain} )} {service.port && ( Docs )}
{service.managed && (
{isDown && ( )} {!isDown && ( )}
)}
) }