import { defineComponent, inject, reactive, ref, } from 'vue'; import { SymBlockLibrary } from '../use-dynamic-blocks'; import './Block.scss'; export const SbBlock = defineComponent({ name: 'sb-block', props: { block: { type: Object, required: true, }, }, setup(props, context) { const el = ref(null); const customBlocks = inject(SymBlockLibrary, reactive({})); const getBlock = (name) => customBlocks[name]; return () => { const BlockComponent = getBlock(props.block.name)?.component || Missing block {name}; return
; }; }, });