import type { VarInInspectType } from '@/types/workflow'
import { cn } from '@langgenius/dify-ui/cn'
import { memo } from 'react'
import { useVarIcon } from '../hooks'

export type VariableIconProps = {
  className?: string
  variables?: string[]
  variableCategory?: VarInInspectType | string
}
const VariableIcon = ({
  className,
  variables = [],
  variableCategory,
}: VariableIconProps) => {
  const VarIcon = useVarIcon(variables, variableCategory)

  return VarIcon && (
    <VarIcon
      className={cn(
        'size-3.5 shrink-0',
        className,
      )}
    />
  )
}

export default memo(VariableIcon)
