import { jsx as _jsx } from "react/jsx-runtime";
import { Match, pipe } from "effect";
import { Text } from "ink";
import { memo } from "react";
// ============================================================================
// Constants
// ============================================================================
/** Status symbol for idle state (checkmark) */
const SYMBOL_IDLE = "\u2713";
/** Status symbol for syncing state (rotating arrow) */
const SYMBOL_SYNCING = "\u21BB";
/** Status symbol for error state (cross) */
const SYMBOL_ERROR = "\u2717";
/** Status symbol for paused state (pause bars) */
const SYMBOL_PAUSED = "\u2016";
// ============================================================================
// Helpers
// ============================================================================
/**
 * Get status configuration for a flow state.
 * Uses Match pattern for exhaustive type safety.
 */
const getStatusConfig = (state) => pipe(Match.value(state), Match.when("idle", () => ({ symbol: SYMBOL_IDLE, color: "green" })), Match.when("syncing", () => ({ symbol: SYMBOL_SYNCING, color: "yellow" })), Match.when("error", () => ({ symbol: SYMBOL_ERROR, color: "red" })), Match.when("paused", () => ({ symbol: SYMBOL_PAUSED, color: "gray" })), Match.exhaustive);
// ============================================================================
// Component
// ============================================================================
/**
 * Colored status badge for flow state.
 */
export const StatusBadge = memo(({ state }) => {
    const config = getStatusConfig(state);
    return _jsx(Text, { color: config.color, children: config.symbol });
});
StatusBadge.displayName = "StatusBadge";
//# sourceMappingURL=StatusBadge.js.map