1234567891011121314151617181920212223242526272829303132333435363738 |
- 'use client'
- import { useTranslation } from 'react-i18next'
- import Link from 'next/link'
- import { useSelectedLayoutSegment } from 'next/navigation'
- import {
- RiCpuFill,
- RiCpuLine,
- } from '@remixicon/react'
- import classNames from '@/utils/classnames'
- type ToolsNavProps = {
- className?: string
- }
- const SkillNav = ({ className }: ToolsNavProps) => {
- const { t } = useTranslation()
- const selectedSegment = useSelectedLayoutSegment()
- const activated = selectedSegment === 'skill'
- return (
- <Link href="/skill" 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
- ? <RiCpuFill className='mr-2 h-4 w-4' />
- : <RiCpuLine className='mr-2 h-4 w-4' />
- }
- {t('common.menus.skill')}
- </Link>
- )
- }
- export default SkillNav
|