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
import { memo } from 'react'
import { useTranslation } from 'react-i18next'
import { RiBookOpenLine } from '@remixicon/react'
import { useNodeHelpLink } from '../hooks/use-node-help-link'
import TooltipPlus from '@/app/components/base/tooltip'
import type { BlockEnum } from '@/app/components/workflow/types'
 
type HelpLinkProps = {
  nodeType: BlockEnum
}
const HelpLink = ({
  nodeType,
}: HelpLinkProps) => {
  const { t } = useTranslation()
  const link = useNodeHelpLink(nodeType)
 
  if (!link)
    return null
 
  return (
    <TooltipPlus
      popupContent={t('common.userProfile.helpCenter')}
    >
      <a
        href={link}
        target='_blank'
        className='mr-1 flex h-6 w-6 items-center justify-center'
      >
        <RiBookOpenLine className='h-4 w-4 text-gray-500' />
      </a>
    </TooltipPlus>
 
  )
}
 
export default memo(HelpLink)