| 12345678910111213141516171819202122232425 |
- import React, { useContext } from 'react';
- import { FlowNodeRegistry } from '@flowgram.ai/fixed-layout-editor';
- import { NodeRenderContext } from '../../context';
- import { FormTitleDescription, FormWrapper } from './styles';
- /**
- * @param props
- * @constructor
- */
- export function FormContent(props: { children?: React.ReactNode }) {
- const { expanded, node } = useContext(NodeRenderContext);
- const registry = node.getNodeRegistry<FlowNodeRegistry>();
- return (
- <FormWrapper>
- {expanded ? (
- <>
- <FormTitleDescription>{registry.info?.description}</FormTitleDescription>
- {props.children}
- </>
- ) : undefined}
- </FormWrapper>
- );
- }
|