help-link.tsx 833 B

123456789101112131415161718192021222324252627282930313233
  1. import { memo } from 'react'
  2. import { useTranslation } from 'react-i18next'
  3. import { RiBookOpenLine } from '@remixicon/react'
  4. import { useNodeHelpLink } from '../hooks/use-node-help-link'
  5. import TooltipPlus from '@/app/components/base/tooltip'
  6. import type { BlockEnum } from '@/app/components/workflow/types'
  7. type HelpLinkProps = {
  8. nodeType: BlockEnum
  9. }
  10. const HelpLink = ({
  11. nodeType,
  12. }: HelpLinkProps) => {
  13. const { t } = useTranslation()
  14. const link = useNodeHelpLink(nodeType)
  15. return (
  16. <TooltipPlus
  17. popupContent={t('common.userProfile.helpCenter')}
  18. >
  19. <a
  20. href={link}
  21. target='_blank'
  22. className='flex items-center justify-center mr-1 w-6 h-6'
  23. >
  24. <RiBookOpenLine className='w-4 h-4 text-gray-500' />
  25. </a>
  26. </TooltipPlus>
  27. )
  28. }
  29. export default memo(HelpLink)