import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
/**
 * Key Hints Component
 *
 * Displays available keyboard shortcuts at bottom of screen.
 * Uses [Key] Label format for visible action indicators.
 */
import { Array as Arr } from "effect";
import { Box, Text } from "ink";
import { memo } from "react";
// ============================================================================
// Helpers
// ============================================================================
/** Format key for display - wraps in brackets if single char, keeps as-is for symbols */
const formatKey = (key) => {
    // Arrow symbols and special keys are displayed as-is
    if (key.includes("\u2191") || key.includes("\u2193") || key === "Esc" || key === "Enter" || key === "Tab") {
        return key;
    }
    // Single char keys get brackets
    return `[${key.toUpperCase()}]`;
};
/** Render a single key hint in [Key] Label format */
const renderKeyHint = (hint) => (_jsx(Box, { children: _jsxs(Text, { dimColor: true, children: [formatKey(hint.key), " ", hint.label] }) }, hint.key));
// ============================================================================
// Component
// ============================================================================
/**
 * Horizontal bar of keyboard shortcuts.
 * Shortcuts are accelerators shown in [Key] Label format.
 */
export const KeyHints = memo(({ hints }) => (_jsx(Box, { borderStyle: "single", borderTop: true, borderBottom: false, borderLeft: false, borderRight: false, paddingX: 1, children: _jsx(Box, { gap: 3, children: Arr.map(hints, renderKeyHint) }) })));
KeyHints.displayName = "KeyHints";
// ============================================================================
// Preset Hints
// ============================================================================
/**
 * Dashboard screen hints - global actions only.
 * Selection-specific actions (Sync, Pause, Remove) appear inline with selected flow.
 */
export const DASHBOARD_HINTS = [
    { key: "\u2191\u2193", label: "Navigate" },
    { key: "a", label: "Add" },
    { key: "q", label: "Quit" }
];
/**
 * Hints for confirmation dialogs.
 */
export const CONFIRM_HINTS = [
    { key: "y", label: "Yes" },
    { key: "n", label: "No" },
    { key: "Esc", label: "Cancel" }
];
/**
 * Hints for wizard steps.
 */
export const WIZARD_HINTS = [
    { key: "Enter", label: "Continue" },
    { key: "Esc", label: "Cancel" }
];
/**
 * Hints for Flow Detail screen.
 */
export const FLOW_DETAIL_HINTS = [
    { key: "Esc", label: "Back" },
    { key: "Tab", label: "Panel" },
    { key: "\u2191\u2193", label: "Navigate" }
];
//# sourceMappingURL=KeyHints.js.map