index.tsx 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  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 { PuzzlePiece01 } from '@/app/components/base/icons/src/vender/line/development'
  7. import { PuzzlePiece01 as PuzzlePiece01Solid } from '@/app/components/base/icons/src/vender/solid/development'
  8. type PluginNavProps = {
  9. className?: string
  10. }
  11. const PluginNav = ({
  12. className,
  13. }: PluginNavProps) => {
  14. const { t } = useTranslation()
  15. const selectedSegment = useSelectedLayoutSegment()
  16. const isPluginsComingSoon = selectedSegment === 'plugins-coming-soon'
  17. return (
  18. <Link href="/plugins-coming-soon" className={classNames(
  19. className, 'group',
  20. isPluginsComingSoon && 'bg-white shadow-md',
  21. isPluginsComingSoon ? 'text-primary-600' : 'text-gray-500 hover:bg-gray-200',
  22. )}>
  23. {
  24. isPluginsComingSoon
  25. ? <PuzzlePiece01Solid className='mr-2 w-4 h-4' />
  26. : <PuzzlePiece01 className='mr-2 w-4 h-4' />
  27. }
  28. {t('common.menus.plugins')}
  29. </Link>
  30. )
  31. }
  32. export default PluginNav