---
import type { RenderableTreeNode } from '@markdoc/markdoc';
import type { AstroInstance } from 'astro';
import { validateComponentsProp } from '../dist/utils.js';
import { ComponentNode, createTreeNode } from './TreeNode.js';
type Props = {
content: RenderableTreeNode;
components?: Record<string, AstroInstance['default']>;
};
const { content, components } = Astro.props as Props;
// Will throw if components is invalid
if (components) {
validateComponentsProp(components);
}
<ComponentNode treeNode={createTreeNode(content, components)} />