import React from 'react';
import { registerWidget, Value } from '../Value';
import { IndentLevelContext, RenderContext, indent } from '../widgetUtils';
registerWidget('union', function (_a) {
    var value = _a.value;
    var level = React.useContext(IndentLevelContext);
    return (React.createElement(RenderContext.Provider, { value: "inline" }, value.value.map(function (v, index) {
        return (React.createElement(React.Fragment, { key: index },
            ' ',
            value.value.length > 3 && (React.createElement(React.Fragment, null,
                React.createElement("br", null),
                indent(level + 1))),
            index !== 0 && React.createElement("span", { className: "token punctuation" }, " |\u00A0"),
            React.createElement(IndentLevelContext.Provider, { value: level + 1 },
                React.createElement(Value, { value: v }))));
    })));
});
