"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ConfirmDialog = ConfirmDialog;
const jsx_runtime_1 = require("react/jsx-runtime");
const ink_1 = require("ink");
const NavigationContext_1 = require("../state/NavigationContext");
function ConfirmDialog({ message, onConfirm, onCancel, }) {
    const { config } = (0, NavigationContext_1.useNavigation)();
    (0, ink_1.useInput)((input, key) => {
        if (input === "y" || input === "Y") {
            onConfirm();
        }
        else {
            onCancel();
        }
    });
    return ((0, jsx_runtime_1.jsxs)(ink_1.Box, { flexDirection: "column", borderStyle: "double", borderColor: config.theme.warning, paddingX: 2, paddingY: 1, children: [(0, jsx_runtime_1.jsx)(ink_1.Text, { color: config.theme.warning, bold: true, children: "Confirm" }), (0, jsx_runtime_1.jsx)(ink_1.Text, { children: message }), (0, jsx_runtime_1.jsxs)(ink_1.Box, { marginTop: 1, children: [(0, jsx_runtime_1.jsx)(ink_1.Text, { color: config.theme.accent, children: "[y] Yes" }), (0, jsx_runtime_1.jsx)(ink_1.Text, { children: " " }), (0, jsx_runtime_1.jsx)(ink_1.Text, { color: config.theme.error, children: "[any key] No" })] })] }));
}
