2023-07-18 16:57:14 +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 {
|
|
|
|
RiPlanetFill,
|
|
|
|
RiPlanetLine,
|
|
|
|
} from '@remixicon/react'
|
2024-07-09 15:05:40 +08:00
|
|
|
import classNames from '@/utils/classnames'
|
2023-07-18 16:57:14 +08:00
|
|
|
type ExploreNavProps = {
|
|
|
|
className?: string
|
|
|
|
}
|
|
|
|
|
|
|
|
const ExploreNav = ({
|
|
|
|
className,
|
|
|
|
}: ExploreNavProps) => {
|
|
|
|
const { t } = useTranslation()
|
|
|
|
const selectedSegment = useSelectedLayoutSegment()
|
2024-09-08 12:14:11 +07:00
|
|
|
const activated = selectedSegment === 'explore'
|
2023-07-18 16:57:14 +08:00
|
|
|
|
|
|
|
return (
|
|
|
|
<Link href="/explore/apps" className={classNames(
|
|
|
|
className, 'group',
|
2024-09-08 12:14:11 +07:00
|
|
|
activated && 'bg-components-main-nav-nav-button-bg-active 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',
|
2023-07-18 16:57:14 +08:00
|
|
|
)}>
|
|
|
|
{
|
2024-09-08 12:14:11 +07:00
|
|
|
activated
|
2025-06-17 17:37:06 +08:00
|
|
|
? <RiPlanetFill className='h-4 w-4' />
|
|
|
|
: <RiPlanetLine className='h-4 w-4' />
|
2023-07-18 16:57:14 +08:00
|
|
|
}
|
2025-06-17 17:37:06 +08:00
|
|
|
<div className='ml-2 max-[1024px]:hidden'>
|
|
|
|
{t('common.menus.explore')}
|
|
|
|
</div>
|
2023-07-18 16:57:14 +08:00
|
|
|
</Link>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
export default ExploreNav
|