index.tsx 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. 'use client'
  2. import { useTranslation } from 'react-i18next'
  3. import Link from 'next/link'
  4. import { useSelectedLayoutSegment } from 'next/navigation'
  5. import classNames from 'classnames'
  6. import { Grid01 } from '@/app/components/base/icons/src/vender/line/layout'
  7. import { Grid01 as Grid01Solid } from '@/app/components/base/icons/src/vender/solid/layout'
  8. type ExploreNavProps = {
  9. className?: string
  10. }
  11. const ExploreNav = ({
  12. className,
  13. }: ExploreNavProps) => {
  14. const { t } = useTranslation()
  15. const selectedSegment = useSelectedLayoutSegment()
  16. const actived = selectedSegment === 'explore'
  17. return (
  18. <Link href="/explore/apps" className={classNames(
  19. className, 'group',
  20. actived && 'bg-white shadow-[0_2px_5px_-1px_rgba(0,0,0,0.05),0_2px_4px_-2px_rgba(0,0,0,0.05)]',
  21. actived ? 'text-primary-600' : 'text-gray-500 hover:bg-gray-200',
  22. )}>
  23. {
  24. actived
  25. ? <Grid01Solid className='mr-2 w-4 h-4' />
  26. : <Grid01 className='mr-2 w-4 h-4' />
  27. }
  28. {t('common.menus.explore')}
  29. </Link>
  30. )
  31. }
  32. export default ExploreNav