import { jsx as _jsx } from "react/jsx-runtime";
import { useXMLViewerContext } from '../../context/xml-viewer-context';
import { hasBreakLines } from '../../helpers';
export function TextElement(props) {
    const { hasSiblings, text, indentation, isText } = props;
    const { theme } = useXMLViewerContext();
    const style = isText ? { color: theme.textColor } : undefined;
    return hasBreakLines(text) || hasSiblings ? (_jsx("div", { style: style, children: text
            .split('\n')
            .filter((element) => !!element.trim())
            .map((line, index) => (_jsx("div", { children: `${indentation}${line.trim()}` }, `${index}`))) })) : (_jsx("span", { style: style, children: text }));
}
//# sourceMappingURL=index.js.map