import type { FC, ReactElement, } from 'react' import { cloneElement, memo, } from 'react' import type { NodeProps } from '../../types' import { BlockEnum } from '@/app/components/workflow/types' import BlockIcon from '@/app/components/workflow/block-icon' import AppIcon from '@/app/components/base/app-icon' type BaseNodeProps = { children: ReactElement } & NodeProps const BaseNode: FC = ({ id, data, children, }) => { const type = data.type return (
{ type !== BlockEnum.Tool && ( ) } { type === BlockEnum.Tool && ( <> { typeof data._icon === 'string' ? (
) : ( ) } ) }
{data.title}
{cloneElement(children, { id, data })}
{ data.desc && (
{data.desc}
) }
) } export default memo(BaseNode)