mirror of
https://github.com/withastro/astro.git
synced 2024-12-23 21:53:55 -05:00
86273b5881
* wip: new TreeNode setup * fix: pass children through `render` * deps: remove stringify-attributes * chore: changeset --------- Co-authored-by: Nate Moore <nate@astro.build> Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
20 lines
557 B
Text
20 lines
557 B
Text
---
|
|
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)} />
|