help-link.tsx 833 B

12345678910111213141516171819202122232425262728293031323334
  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='mr-1 flex h-6 w-6 items-center justify-center'
  23. >
  24. <RiBookOpenLine className='h-4 w-4 text-gray-500' />
  25. </a>
  26. </TooltipPlus>
  27. )
  28. }
  29. export default memo(HelpLink)