import { jsx as _jsx } from "react/jsx-runtime";
import { Box, Text, useInput } from 'ink';
export function RunControls({ running, cancelling, keyboardDisabled = false, onCancel }) {
    useInput((_input, key) => {
        if (!running || cancelling || !key.escape) {
            return;
        }
        onCancel();
    }, { isActive: running && !cancelling && !keyboardDisabled });
    if (running || cancelling) {
        return (_jsx(Box, { marginTop: 1, children: _jsx(Text, { color: "yellow", children: cancelling ? 'Stop requested...' : 'Run active · Esc to stop' }) }));
    }
    return null;
}
//# sourceMappingURL=RunControls.js.map