mirror of
				https://github.com/langgenius/dify.git
				synced 2025-11-04 04:43:09 +00:00 
			
		
		
		
	Co-authored-by: NFish <douxc512@gmail.com> Co-authored-by: zxhlyh <jasonapring2015@outlook.com> Co-authored-by: twwu <twwu@dify.ai> Co-authored-by: jZonG <jzongcode@gmail.com>
		
			
				
	
	
		
			40 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			40 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
'use client'
 | 
						|
 | 
						|
import { useTranslation } from 'react-i18next'
 | 
						|
import Link from 'next/link'
 | 
						|
import { useSelectedLayoutSegment } from 'next/navigation'
 | 
						|
import {
 | 
						|
  RiHammerFill,
 | 
						|
  RiHammerLine,
 | 
						|
} from '@remixicon/react'
 | 
						|
import classNames from '@/utils/classnames'
 | 
						|
type ToolsNavProps = {
 | 
						|
  className?: string
 | 
						|
}
 | 
						|
 | 
						|
const ToolsNav = ({
 | 
						|
  className,
 | 
						|
}: ToolsNavProps) => {
 | 
						|
  const { t } = useTranslation()
 | 
						|
  const selectedSegment = useSelectedLayoutSegment()
 | 
						|
  const activated = selectedSegment === 'tools'
 | 
						|
 | 
						|
  return (
 | 
						|
    <Link href="/tools" className={classNames(
 | 
						|
      'group text-sm font-medium',
 | 
						|
      activated && 'font-semibold bg-components-main-nav-nav-button-bg-active hover:bg-components-main-nav-nav-button-bg-active-hover shadow-md',
 | 
						|
      activated ? 'text-components-main-nav-nav-button-text-active' : 'text-components-main-nav-nav-button-text hover:bg-components-main-nav-nav-button-bg-hover',
 | 
						|
      className,
 | 
						|
    )}>
 | 
						|
      {
 | 
						|
        activated
 | 
						|
          ? <RiHammerFill className='mr-2 h-4 w-4' />
 | 
						|
          : <RiHammerLine className='mr-2 h-4 w-4' />
 | 
						|
      }
 | 
						|
      {t('common.menus.tools')}
 | 
						|
    </Link>
 | 
						|
  )
 | 
						|
}
 | 
						|
 | 
						|
export default ToolsNav
 |