- fix(FN-2729): silence ansi strip lint warning - test(FN-2729): complete Step 10 — cover node health indicators - feat(FN-2729): complete Step 9 — colorize CLI node status output - feat(FN-2729): complete Step 8 — use NodeHealthDot in settings routing status - test(FN-2729): align ListView node override option expectations - feat(FN-2729): complete Step 7 — add bulk node status indicators - fix(engine): prevent auto-merge cooldown loop on unresolvable conflicts - feat(FN-2911): improve chat attachment compose and preview UX - feat(FN-2921): merge fusion/fn-2921 - feat(FN-2909): merge fusion/fn-2909 - feat(FN-2914): merge fusion/fn-2914 - feat(FN-2902): merge fusion/fn-2902 - chore(release): v0.8.3 - Update changeset - fix(tui): swap 3/4 panel hotkeys so they match the help text - fix(tui): always show auth token and report accurate macOS memory usage Fusion-Task-Id: FN-2729
29 lines
844 B
TypeScript
29 lines
844 B
TypeScript
import type { NodeStatus } from "@fusion/core";
|
|
import "./NodeHealthDot.css";
|
|
|
|
export interface NodeHealthDotProps {
|
|
status: NodeStatus;
|
|
showLabel?: boolean;
|
|
className?: string;
|
|
compact?: boolean;
|
|
}
|
|
|
|
function toStatusLabel(status: NodeStatus): string {
|
|
return status.charAt(0).toUpperCase() + status.slice(1);
|
|
}
|
|
|
|
export function NodeHealthDot({ status, showLabel = false, className, compact = false }: NodeHealthDotProps) {
|
|
const label = toStatusLabel(status);
|
|
|
|
return (
|
|
<span
|
|
className={`node-health-dot${compact ? " node-health-dot--compact" : ""}${className ? ` ${className}` : ""}`}
|
|
title={label}
|
|
aria-label={`Node status: ${label}`}
|
|
>
|
|
<span className={`status-dot status-dot--${status}`} />
|
|
{showLabel ? <span className="node-health-dot__label">{label}</span> : null}
|
|
</span>
|
|
);
|
|
}
|