19 lines
558 B
Text
19 lines
558 B
Text
---
|
|
import type { RenderableTreeNode } from '@markdoc/markdoc';
|
|
import type { AstroInstance } from 'astro';
|
|
import { validateComponentsProp } from '../dist/utils.js';
|
|
import { createAstroNode } from './astroNode';
|
|
import RenderNode from './RenderNode.astro';
|
|
|
|
type Props = {
|
|
content: RenderableTreeNode;
|
|
components: Record<string, AstroInstance['default']>;
|
|
};
|
|
|
|
const { content, components } = Astro.props as Props;
|
|
|
|
// Will throw if components is invalid
|
|
validateComponentsProp(components);
|
|
---
|
|
|
|
<RenderNode node={createAstroNode(content, components)} />
|