wwf
2025-05-20 938c3e5a587ce950a94964ea509b9e7f8834dfae
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
'use client'
import React from 'react'
import type { FC } from 'react'
import { ApiConnection } from '@/app/components/base/icons/src/vender/solid/development'
import InputVarTypeIcon from '@/app/components/workflow/nodes/_base/components/input-var-type-icon'
import { InputVarType } from '@/app/components/workflow/types'
 
export type IInputTypeIconProps = {
  type: 'string' | 'select'
  className: string
}
 
const IconMap = (type: IInputTypeIconProps['type'], className: string) => {
  const classNames = `w-3.5 h-3.5 ${className}`
  const icons = {
    string: (
      <InputVarTypeIcon type={InputVarType.textInput} className={classNames} />
    ),
    paragraph: (
      <InputVarTypeIcon type={InputVarType.paragraph} className={classNames} />
    ),
    select: (
      <InputVarTypeIcon type={InputVarType.select} className={classNames} />
    ),
    number: (
      <InputVarTypeIcon type={InputVarType.number} className={classNames} />
    ),
    api: (
      <ApiConnection className={classNames} />
    ),
  }
 
  return icons[type]
}
 
const InputTypeIcon: FC<IInputTypeIconProps> = ({
  type,
  className,
}) => {
  const Icon = IconMap(type, className)
  return Icon
}
 
export default React.memo(InputTypeIcon)