/** * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates * SPDX-License-Identifier: MIT */ import React from 'react'; import { IJsonSchema } from '@flowgram.ai/json-schema'; import { Popover, Tag } from '@douyinfe/semi-ui'; import { useTypeManager } from '@/plugins'; import { DisplaySchemaTree } from '@/components/display-schema-tree'; import './styles.css'; interface PropsType { title?: JSX.Element | string; value?: IJsonSchema; showIconInTree?: boolean; warning?: boolean; } export function DisplaySchemaTag({ value = {}, showIconInTree, title, warning }: PropsType) { const typeManager = useTypeManager(); const icon = typeManager?.getDisplayIcon(value) || typeManager.getDisplayIcon({ type: 'unknown' }); return ( } > {icon && React.cloneElement(icon, { className: 'tag-icon', })} {title && {title}} ); }