mirror of
https://github.com/whyour/qinglong.git
synced 2025-12-13 07:25:05 +08:00
25 lines
709 B
TypeScript
25 lines
709 B
TypeScript
import React from 'react';
|
|
|
|
import { FlowNodeRegistry } from '@flowgram.ai/fixed-layout-editor';
|
|
|
|
import { useIsSidebar, useNodeRenderContext } from '../../hooks';
|
|
import { FormTitleDescription, FormWrapper } from './styles';
|
|
|
|
/**
|
|
* @param props
|
|
* @constructor
|
|
*/
|
|
export function FormContent(props: { children?: React.ReactNode }) {
|
|
const { node, expanded } = useNodeRenderContext();
|
|
const isSidebar = useIsSidebar();
|
|
const registry = node.getNodeRegistry<FlowNodeRegistry>();
|
|
return (
|
|
<FormWrapper>
|
|
<>
|
|
{isSidebar && <FormTitleDescription>{registry.info?.description}</FormTitleDescription>}
|
|
{(expanded || isSidebar) && props.children}
|
|
</>
|
|
</FormWrapper>
|
|
);
|
|
}
|