import * as React from 'react';
import { Spoiler } from './Spoiler';
import { Code } from './Code';
import { Kbd } from './Kbd';
import { Ins } from './Ins';
import { Del } from './Del';
import { Link } from './Link';
export const RenderInline = (props) => {
    const { inline, children } = props;
    const attrs = inline.attr();
    let element = children;
    const a = attrs[-9 /* SliceTypeCon.a */];
    if (a)
        element = (React.createElement(Link, { layers: a.length, stack: a }, element));
    if (attrs[-8 /* SliceTypeCon.mark */])
        element = React.createElement("mark", null, element);
    if (attrs[-13 /* SliceTypeCon.sup */])
        element = React.createElement("sup", null, element);
    if (attrs[-14 /* SliceTypeCon.sub */])
        element = React.createElement("sub", null, element);
    if (attrs[-15 /* SliceTypeCon.math */])
        element = React.createElement("code", null, element);
    if (attrs[-12 /* SliceTypeCon.ins */])
        element = React.createElement(Ins, null, element);
    if (attrs[-11 /* SliceTypeCon.del */])
        element = React.createElement(Del, null, element);
    if (attrs[-7 /* SliceTypeCon.code */]) {
        const attr = attrs[-7 /* SliceTypeCon.code */][0];
        if (attr)
            element = React.createElement(Code, { attr: attr }, element);
    }
    if (attrs[-19 /* SliceTypeCon.kbd */]) {
        const attr = attrs[-19 /* SliceTypeCon.kbd */][0];
        if (attr)
            element = React.createElement(Kbd, { attr: attr }, element);
    }
    if (attrs[-20 /* SliceTypeCon.spoiler */])
        element = React.createElement(Spoiler, null, element);
    return element;
};
//# sourceMappingURL=RenderInline.js.map