|
|
|
@ -22,7 +22,8 @@ type Props = {
|
|
|
|
isShowLetterIndex: boolean
|
|
|
|
isShowLetterIndex: boolean
|
|
|
|
hasSearchText: boolean
|
|
|
|
hasSearchText: boolean
|
|
|
|
onSelect: (type: BlockEnum, tool?: ToolDefaultValue) => void
|
|
|
|
onSelect: (type: BlockEnum, tool?: ToolDefaultValue) => void
|
|
|
|
onSelectMultiple: (type: BlockEnum, tools: ToolDefaultValue[]) => void
|
|
|
|
canNotSelectMultiple?: boolean
|
|
|
|
|
|
|
|
onSelectMultiple?: (type: BlockEnum, tools: ToolDefaultValue[]) => void
|
|
|
|
selectedTools?: ToolValue[]
|
|
|
|
selectedTools?: ToolValue[]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -33,6 +34,7 @@ const Tool: FC<Props> = ({
|
|
|
|
isShowLetterIndex,
|
|
|
|
isShowLetterIndex,
|
|
|
|
hasSearchText,
|
|
|
|
hasSearchText,
|
|
|
|
onSelect,
|
|
|
|
onSelect,
|
|
|
|
|
|
|
|
canNotSelectMultiple,
|
|
|
|
onSelectMultiple,
|
|
|
|
onSelectMultiple,
|
|
|
|
selectedTools,
|
|
|
|
selectedTools,
|
|
|
|
}) => {
|
|
|
|
}) => {
|
|
|
|
@ -68,7 +70,7 @@ const Tool: FC<Props> = ({
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<span className='system-xs-regular text-components-button-secondary-accent-text'
|
|
|
|
<span className='system-xs-regular text-components-button-secondary-accent-text'
|
|
|
|
onClick={(e) => {
|
|
|
|
onClick={(e) => {
|
|
|
|
onSelectMultiple(BlockEnum.Tool, actions.filter(action => !getIsDisabled(action)).map((tool) => {
|
|
|
|
onSelectMultiple?.(BlockEnum.Tool, actions.filter(action => !getIsDisabled(action)).map((tool) => {
|
|
|
|
const params: Record<string, string> = {}
|
|
|
|
const params: Record<string, string> = {}
|
|
|
|
if (tool.parameters) {
|
|
|
|
if (tool.parameters) {
|
|
|
|
tool.parameters.forEach((item) => {
|
|
|
|
tool.parameters.forEach((item) => {
|
|
|
|
@ -186,7 +188,7 @@ const Tool: FC<Props> = ({
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div className='ml-2 flex items-center'>
|
|
|
|
<div className='ml-2 flex items-center'>
|
|
|
|
{notShowProvider ? notShowProviderSelectInfo : selectedInfo}
|
|
|
|
{!canNotSelectMultiple && (notShowProvider ? notShowProviderSelectInfo : selectedInfo)}
|
|
|
|
{hasAction && (
|
|
|
|
{hasAction && (
|
|
|
|
<FoldIcon className={cn('h-4 w-4 shrink-0 text-text-quaternary', isFold && 'text-text-tertiary')} />
|
|
|
|
<FoldIcon className={cn('h-4 w-4 shrink-0 text-text-quaternary', isFold && 'text-text-tertiary')} />
|
|
|
|
)}
|
|
|
|
)}
|
|
|
|
|