mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-05-23 21:19:03 +08:00

Co-authored-by: StyleZhang <jasonapring2015@outlook.com> Co-authored-by: Joel <iamjoel007@gmail.com>
38 lines
1020 B
TypeScript
38 lines
1020 B
TypeScript
'use client'
|
|
|
|
import { useTranslation } from 'react-i18next'
|
|
import Link from 'next/link'
|
|
import { useSelectedLayoutSegment } from 'next/navigation'
|
|
import classNames from 'classnames'
|
|
import { Grid01 } from '@/app/components/base/icons/src/vender/line/layout'
|
|
import { Grid01 as Grid01Solid } from '@/app/components/base/icons/src/vender/solid/layout'
|
|
|
|
type ExploreNavProps = {
|
|
className?: string
|
|
}
|
|
|
|
const ExploreNav = ({
|
|
className,
|
|
}: ExploreNavProps) => {
|
|
const { t } = useTranslation()
|
|
const selectedSegment = useSelectedLayoutSegment()
|
|
const actived = selectedSegment === 'explore'
|
|
|
|
return (
|
|
<Link href="/explore/apps" className={classNames(
|
|
className, 'group',
|
|
actived && 'bg-white shadow-md',
|
|
actived ? 'text-primary-600' : 'text-gray-500 hover:bg-gray-200',
|
|
)}>
|
|
{
|
|
actived
|
|
? <Grid01Solid className='mr-2 w-4 h-4' />
|
|
: <Grid01 className='mr-2 w-4 h-4' />
|
|
}
|
|
{t('common.menus.explore')}
|
|
</Link>
|
|
)
|
|
}
|
|
|
|
export default ExploreNav
|