diff --git a/ui/blocks/src/Description/Description.tsx b/ui/blocks/src/Description/Description.tsx index 391f74710..cb5ee7ab1 100644 --- a/ui/blocks/src/Description/Description.tsx +++ b/ui/blocks/src/Description/Description.tsx @@ -1,7 +1,11 @@ import React, { FC } from 'react'; import { Markdown, MarkdownProps } from '@component-controls/components'; import { ComponentsContainer } from '../BlockContainer/components/ComponentsContainer'; -import { useComponents, ComponentInputProps } from '@component-controls/store'; +import { + useComponents, + ComponentInputProps, + useCurrentDocument, +} from '@component-controls/store'; export type DescriptionProps = Omit & ComponentInputProps; @@ -12,14 +16,20 @@ export type DescriptionProps = Omit & */ export const Description: FC = ({ of, ...rest }) => { const components = useComponents({ of }); + const doc = useCurrentDocument(); return ( - - {component => { - if (!component || !component.info || !component.info.description) { - return null; - } - return {component.info.description}; - }} - + <> + + {component => { + if (!component || !component.info || !component.info.description) { + return null; + } + return {component.info.description}; + }} + + {doc && doc.description && ( + {doc.description} + )} + ); };