help-link.tsx 856 B

1234567891011121314151617181920212223242526272829303132
  1. import { memo } from 'react'
  2. import { useTranslation } from 'react-i18next'
  3. import { useNodeHelpLink } from '../hooks/use-node-help-link'
  4. import TooltipPlus from '@/app/components/base/tooltip-plus'
  5. import { BookOpen02 } from '@/app/components/base/icons/src/vender/line/education'
  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 popupContent={t('common.userProfile.helpCenter')}>
  17. <a
  18. href={link}
  19. target='_blank'
  20. className='flex items-center justify-center mr-1 w-6 h-6'
  21. >
  22. <BookOpen02 className='w-4 h-4 text-gray-500' />
  23. </a>
  24. </TooltipPlus>
  25. )
  26. }
  27. export default memo(HelpLink)