This commit is contained in:
StyleZhang
2024-02-18 17:56:00 +08:00
parent da84ba06c7
commit dce01cf002
6 changed files with 150 additions and 47 deletions

View File

@ -31,54 +31,56 @@ const BasePanel: FC<BasePanelProps> = ({
} = useWorkflowContext()
return (
<div className='absolute top-2 right-2 bottom-2 w-[420px] bg-white shadow-lg border-[0.5px] border-gray-200 rounded-2xl z-20'>
<div className='flex items-center px-4 pt-3'>
<BlockIcon
className='shrink-0 mr-2'
type={selectedNode!.data.type}
size='md'
/>
<div className='grow py-1 text-base text-gray-900 font-semibold '>LLM</div>
<div className='shrink-0 flex items-center'>
<div
className='w-6 h-6 cursor-pointer'
onClick={() => handleSelectedNodeIdChange('')}
>
<XClose className='w-4 h-4 text-gray-500' />
<div className='absolute top-2 right-2 bottom-2 w-[420px] bg-white shadow-lg border-[0.5px] border-gray-200 rounded-2xl z-20 overflow-y-auto'>
<div className='sticky top-0 bg-white'>
<div className='flex items-center px-4 pt-3'>
<BlockIcon
className='shrink-0 mr-2'
type={selectedNode!.data.type}
size='md'
/>
<div className='grow py-1 text-base text-gray-900 font-semibold '>LLM</div>
<div className='shrink-0 flex items-center'>
<div
className='w-6 h-6 cursor-pointer'
onClick={() => handleSelectedNodeIdChange('')}
>
<XClose className='w-4 h-4 text-gray-500' />
</div>
</div>
</div>
</div>
<div className='p-2'>
<div className='py-[5px] pl-1.5 pr-2 text-xs text-gray-400'>
Add description...
</div>
</div>
{
(inputsElement || outputsElement) && (
<div className='flex items-center px-4 h-[42px]'>
{
inputsElement && (
<div
className='cursor-pointer'
onClick={() => setActiveTab(TabEnum.Inputs)}
>
inputs
</div>
)
}
{
outputsElement && (
<div
className='ml-4 cursor-pointer'
onClick={() => setActiveTab(TabEnum.Outputs)}
>
outpus
</div>
)
}
<div className='p-2'>
<div className='py-[5px] pl-1.5 pr-2 text-xs text-gray-400'>
Add description...
</div>
)
}
</div>
{
(inputsElement || outputsElement) && (
<div className='flex items-center px-4 h-[42px]'>
{
inputsElement && (
<div
className='cursor-pointer'
onClick={() => setActiveTab(TabEnum.Inputs)}
>
inputs
</div>
)
}
{
outputsElement && (
<div
className='ml-4 cursor-pointer'
onClick={() => setActiveTab(TabEnum.Outputs)}
>
outpus
</div>
)
}
</div>
)
}
</div>
<div className='py-2 border-t-[0.5px] border-b-[0.5px] border-black/5'>
{defaultElement}
{activeTab === TabEnum.Inputs && inputsElement}