mirror of
https://github.com/langgenius/dify.git
synced 2026-05-04 17:38:04 +08:00
block-icon
This commit is contained in:
@ -26,7 +26,10 @@ const NextStep = ({
|
||||
return (
|
||||
<div className='flex py-1'>
|
||||
<div className='shrink-0 relative flex items-center justify-center w-9 h-9 bg-white rounded-lg border-[0.5px] border-gray-200 shadow-xs'>
|
||||
<BlockIcon type={selectedNode!.data.type} />
|
||||
<BlockIcon
|
||||
type={selectedNode!.data.type}
|
||||
icon={selectedNode!.data._icon}
|
||||
/>
|
||||
</div>
|
||||
<Line linesNumber={branches ? branches.length : 1} />
|
||||
<div className='grow'>
|
||||
|
||||
@ -53,6 +53,7 @@ const Item = ({
|
||||
}
|
||||
<BlockIcon
|
||||
type={data.type}
|
||||
icon={data._icon}
|
||||
className='shrink-0 mr-1.5'
|
||||
/>
|
||||
<div className='grow'>{data.title}</div>
|
||||
|
||||
@ -7,9 +7,7 @@ import {
|
||||
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
|
||||
@ -31,40 +29,12 @@ const BaseNode: FC<BaseNodeProps> = ({
|
||||
`}
|
||||
>
|
||||
<div className='flex items-center px-3 pt-3 pb-2'>
|
||||
{
|
||||
type !== BlockEnum.Tool && (
|
||||
<BlockIcon
|
||||
className='shrink-0 mr-2'
|
||||
type={data.type}
|
||||
size='md'
|
||||
/>
|
||||
)
|
||||
}
|
||||
{
|
||||
type === BlockEnum.Tool && (
|
||||
<>
|
||||
{
|
||||
typeof data._icon === 'string'
|
||||
? (
|
||||
<div
|
||||
className='shrink-0 mr-2 w-6 h-6 bg-cover bg-center rounded-md'
|
||||
style={{
|
||||
backgroundImage: `url(${data._icon})`,
|
||||
}}
|
||||
></div>
|
||||
)
|
||||
: (
|
||||
<AppIcon
|
||||
className='shrink-0 mr-2'
|
||||
size='tiny'
|
||||
icon={data._icon?.content}
|
||||
background={data._icon?.background}
|
||||
/>
|
||||
)
|
||||
}
|
||||
</>
|
||||
)
|
||||
}
|
||||
<BlockIcon
|
||||
className='shrink-0 mr-2'
|
||||
type={data.type}
|
||||
size='md'
|
||||
icon={data._icon}
|
||||
/>
|
||||
<div
|
||||
title={data.title}
|
||||
className='grow text-[13px] font-semibold text-gray-700 truncate'
|
||||
|
||||
@ -24,7 +24,6 @@ import { Play } from '@/app/components/base/icons/src/vender/line/mediaAndDevice
|
||||
import TooltipPlus from '@/app/components/base/tooltip-plus'
|
||||
import type { Node } from '@/app/components/workflow/types'
|
||||
import { BlockEnum } from '@/app/components/workflow/types'
|
||||
import AppIcon from '@/app/components/base/app-icon'
|
||||
|
||||
type BasePanelProps = {
|
||||
children: ReactElement
|
||||
@ -51,40 +50,12 @@ const BasePanel: FC<BasePanelProps> = ({
|
||||
<div className='w-[420px] h-full bg-white shadow-lg border-[0.5px] border-gray-200 rounded-2xl overflow-y-auto'>
|
||||
<div className='sticky top-0 bg-white border-b-[0.5px] border-black/5 z-10'>
|
||||
<div className='flex items-center px-4 pt-4 pb-1'>
|
||||
{
|
||||
type !== BlockEnum.Tool && (
|
||||
<BlockIcon
|
||||
className='shrink-0 mr-1'
|
||||
type={data.type}
|
||||
size='md'
|
||||
/>
|
||||
)
|
||||
}
|
||||
{
|
||||
type === BlockEnum.Tool && (
|
||||
<>
|
||||
{
|
||||
typeof data._icon === 'string'
|
||||
? (
|
||||
<div
|
||||
className='shrink-0 mr-2 w-6 h-6 bg-cover bg-center rounded-md'
|
||||
style={{
|
||||
backgroundImage: `url(${data._icon})`,
|
||||
}}
|
||||
></div>
|
||||
)
|
||||
: (
|
||||
<AppIcon
|
||||
className='shrink-0 mr-2'
|
||||
size='tiny'
|
||||
icon={data._icon?.content}
|
||||
background={data._icon?.background}
|
||||
/>
|
||||
)
|
||||
}
|
||||
</>
|
||||
)
|
||||
}
|
||||
<BlockIcon
|
||||
className='shrink-0 mr-1'
|
||||
type={data.type}
|
||||
icon={data._icon}
|
||||
size='md'
|
||||
/>
|
||||
<TitleInput
|
||||
value={data.title || ''}
|
||||
onChange={handleTitleChange}
|
||||
|
||||
Reference in New Issue
Block a user