import React from 'react'; import hljs from 'highlight.js'; export function objectToComponent(object, index) { if (object === null) return; const children = object.children; if (object.type === 'html') { return React.createElement('div', { key: index, dangerouslySetInnerHTML: { __html: children } }); } if (object.type === 'code') { const highlightedCode = hljs.highlight('javascript', children).value; return (