Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
omni-code / tui / dist / components / ConfirmDialog.js
Size: Mime:
import React from "react";
import { Box, Text, useInput } from "ink";
export function ConfirmDialog({ message, onConfirm, onCancel }) {
    useInput((input, key) => {
        if (input === "y" || input === "Y") {
            onConfirm();
            return;
        }
        if (input === "n" || input === "N" || key.escape) {
            onCancel();
            return;
        }
    });
    return (React.createElement(Box, { borderStyle: "round", borderColor: "yellow", paddingX: 2, paddingY: 0, flexDirection: "column" },
        React.createElement(Text, { color: "yellow" }, message),
        React.createElement(Text, null,
            React.createElement(Text, { color: "green", bold: true }, "y"),
            React.createElement(Text, { color: "gray" }, "es / "),
            React.createElement(Text, { color: "red", bold: true }, "n"),
            React.createElement(Text, { color: "gray" }, "o"))));
}
//# sourceMappingURL=ConfirmDialog.js.map