import*as t from"react";import{useMemo as n}from"react";import m from"@markdoc/markdoc";import{components as s}from"@redocly-markdoc/components";import{components as p}from"@redocly/theme/markdoc/default";import{isTag as c}from"../../../../markdoc/helpers/guards/is-tag";const d=r=>n(()=>{if(!r)return null;let o;if(typeof r=="string")try{o=JSON.parse(r)}catch(e){return console.error("Error parsing AST string:",e),null}else o=r;return c(o)?m.renderers.react(o,t,{components:{...globalThis.__LOADER?.markdocComponents,...p,...s}}):null},[r]);export{d as useMarkdocRenderer};
