wwf
2 天以前 a430284aa21e3ae1f0d5654e55b2ad2852519cc2
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
import { memo } from 'react'
import {
  RiHashtag,
  RiTextSnippet,
  RiTimeLine,
} from '@remixicon/react'
import { MetadataFilteringVariableType } from '@/app/components/workflow/nodes/knowledge-retrieval/types'
import cn from '@/utils/classnames'
 
type MetadataIconProps = {
  type?: MetadataFilteringVariableType
  className?: string
}
const MetadataIcon = ({
  type,
  className,
}: MetadataIconProps) => {
  return (
    <>
      {
        (type === MetadataFilteringVariableType.string || type === MetadataFilteringVariableType.select) && (
          <RiTextSnippet className={cn('h-3.5 w-3.5', className)} />
        )
      }
      {
        type === MetadataFilteringVariableType.number && (
          <RiHashtag className={cn('h-3.5 w-3.5', className)} />
        )
      }
      {
        type === MetadataFilteringVariableType.time && (
          <RiTimeLine className={cn('h-3.5 w-3.5', className)} />
        )
      }
    </>
  )
}
 
export default memo(MetadataIcon)