/** * 图应用渲染组件 */ import classnames from 'classnames'; import type { PropsWithChildren } from 'react'; import React, { CSSProperties } from 'react'; import { PREFIX } from '../constants'; import type { Application } from '../spec'; import { useImplementWidgets } from '../utils/widget'; export interface GIRenderProps extends Pick, 'className' | 'style'> { /** * 图应用配置描述 */ config: Application; } export const GIRender: React.FC> = (props) => { const { className, style, config, children } = props; const renderWidgets = useImplementWidgets(config.spec.widgets); const containerStyle: CSSProperties = { height: 'inherit', position: 'relative', ...style, }; return (
{renderWidgets} {children}
); };