"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.NodeDialog = void 0;
const tslib_1 = require("tslib");
const ui_kit_1 = require("@stoplight/ui-kit");
const ScrollContainer_1 = require("@stoplight/ui-kit/ScrollContainer");
const React = tslib_1.__importStar(require("react"));
const constants_1 = require("../../constants");
const Docs_1 = require("../../containers/Docs");
const node_1 = require("../../utils/node");
const GoToRef_1 = require("./GoToRef");
exports.NodeDialog = (_a) => {
    var { edge, direction } = _a, dialogProps = tslib_1.__rest(_a, ["edge", "direction"]);
    const nodeName = edge && edge[`${direction}BranchNodeName`];
    const nodeUri = edge && edge[`${direction}BranchNodeUri`];
    const nodeType = edge && edge[`${direction}BranchNodeType`];
    const nodeVersion = edge && edge[`${direction}BranchNodeVersion`];
    const showGoToRef = !node_1.isIrrelevantNodeType(nodeType);
    return (React.createElement(ui_kit_1.Dialog, Object.assign({}, dialogProps, { isOpen: !!edge, title: React.createElement("div", { className: "flex items-center mr-2" },
            React.createElement("div", { className: "flex-1 flex items-center" },
                nodeName,
                " ",
                nodeVersion !== '0.0' && React.createElement("span", { className: "mx-2 text-base text-gray-6" },
                    "v",
                    nodeVersion)),
            showGoToRef && (React.createElement(GoToRef_1.GoToRef, { className: "text-base", uri: nodeUri }, "Go to ref"))), icon: React.createElement(ui_kit_1.Icon, { icon: constants_1.NodeTypeIcons[nodeType], iconSize: 20, color: constants_1.NodeTypeColors[nodeType] }), style: { width: 800, height: 500 } }),
        React.createElement("div", { className: "h-full" },
            React.createElement(ScrollContainer_1.ScrollContainer, null,
                React.createElement(Docs_1.Docs, { className: "p-10", node: nodeUri })))));
};
//# sourceMappingURL=NodeDialog.js.map