import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { Button } from "antd";
import { CrossCircle } from "./Icons/CrossCircle";
import { blockExplorerUrl } from "./Links";
import { useEffect, useState } from "react";
import Modal from "antd/lib/modal";
const openUrl = (url) => {
    window.open(url, "_new");
};
export const NewcoinRecept = ({ children, visible, onDone, tx }) => {
    const [_visible, _setVisible] = useState(!!visible);
    useEffect(() => {
        _setVisible(!!tx && !!visible);
    }, [tx, visible]);
    return (_jsxs(Modal, { closeIcon: _jsx(CrossCircle, {}), visible: _visible, okText: "Yes", cancelText: "No", onCancel: () => {
            _setVisible(false);
            onDone && onDone();
        }, 
        // onCancel={() => setMode(STAKE_STEPS.SELECT)}
        // onCancel={() => onCancel && onCancel() }
        cancelButtonProps: { value: "No" }, footer: false, className: "nl-white-box-modal", children: [children, _jsx("div", { className: "nl-vertical-space", children: "\u00A0" }), _jsxs("div", { className: "text-center", style: { marginTop: 20 }, children: [_jsx(Button, { className: "nl-button-primary", onClick: () => openUrl(blockExplorerUrl.newcoin(tx)), children: "View on Newcoin" }), _jsx(Button, { className: "nl-button-primary", onClick: () => openUrl(blockExplorerUrl.blocks(tx)), children: "View on Bloks.io" })] })] }));
};
//# sourceMappingURL=Recepts.js.map