import type { Component } from 'solid-js' import type { ConnectionStatus } from '~/components/types' export interface ConnectionIndicatorProps { status: ConnectionStatus showLabel?: boolean } const statusConfig = { connected: { dotClass: 'bg-emerald-400', label: 'Connected to inspector', }, connecting: { dotClass: 'bg-amber-400 animate-pulse', label: 'Connecting…', }, disconnected: { dotClass: 'bg-red-400', label: 'Disconnected', }, } const ConnectionIndicator: Component = (props) => { const config = () => statusConfig[props.status] return (
{props.showLabel !== false && (

Bun Test UI

{config().label}

)}
) } export default ConnectionIndicator