import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { useInput, Box, Text } from 'ink';
export function DirectShellConfirmationPanel({ confirmation, onResolve, }) {
    useInput((input) => {
        const normalized = input.toLowerCase();
        if (normalized === 'y') {
            onResolve(true);
        }
        if (normalized === 'n' || normalized === '\u001b') {
            onResolve(false);
        }
    }, { isActive: true });
    return (_jsxs(Box, { borderStyle: "round", borderColor: "yellow", flexDirection: "column", paddingX: 1, marginTop: 1, children: [_jsx(Text, { bold: true, color: "yellow", children: "Confirm shell command" }), _jsx(Text, { children: confirmation.command }), confirmation.reason ? _jsx(Text, { dimColor: true, children: confirmation.reason }) : null, _jsxs(Text, { children: [_jsx(Text, { color: "cyan", children: "y" }), _jsx(Text, { dimColor: true, children: " run once \u00B7 " }), _jsx(Text, { color: "cyan", children: "n" }), _jsx(Text, { dimColor: true, children: " cancel" })] })] }));
}
//# sourceMappingURL=DirectShellConfirmationPanel.js.map