2024-01-23 19:31:56 +08:00
|
|
|
'use client'
|
|
|
|
|
|
|
|
import { useTranslation } from 'react-i18next'
|
|
|
|
import Link from 'next/link'
|
|
|
|
import { useSelectedLayoutSegment } from 'next/navigation'
|
2024-06-20 11:05:08 +08:00
|
|
|
import {
|
|
|
|
RiHammerFill,
|
|
|
|
RiHammerLine,
|
|
|
|
} from '@remixicon/react'
|
2024-07-09 15:05:40 +08:00
|
|
|
import classNames from '@/utils/classnames'
|
2024-01-23 19:31:56 +08:00
|
|
|
type ToolsNavProps = {
|
|
|
|
className?: string
|
|
|
|
}
|
|
|
|
|
|
|
|
const ToolsNav = ({
|
|
|
|
className,
|
|
|
|
}: ToolsNavProps) => {
|
|
|
|
const { t } = useTranslation()
|
|
|
|
const selectedSegment = useSelectedLayoutSegment()
|
2024-09-08 12:14:11 +07:00
|
|
|
const activated = selectedSegment === 'tools'
|
2024-01-23 19:31:56 +08:00
|
|
|
|
|
|
|
return (
|
|
|
|
<Link href="/tools" className={classNames(
|
2024-12-12 10:09:48 +08:00
|
|
|
'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,
|
2024-01-23 19:31:56 +08:00
|
|
|
)}>
|
|
|
|
{
|
2024-09-08 12:14:11 +07:00
|
|
|
activated
|
2025-03-21 17:41:03 +08:00
|
|
|
? <RiHammerFill className='mr-2 h-4 w-4' />
|
|
|
|
: <RiHammerLine className='mr-2 h-4 w-4' />
|
2024-01-23 19:31:56 +08:00
|
|
|
}
|
|
|
|
{t('common.menus.tools')}
|
|
|
|
</Link>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
export default ToolsNav
|