import { useTranslation } from 'react-i18next'
import { Link } from 'react-router-dom'
import LanguageSelector from './LanguageSelector'
import ThemeToggle from './ThemeToggle'

interface NavProps {
  currentPage?: string
}

function Nav({ currentPage }: NavProps) {
  const { t } = useTranslation()

  return (
    <nav className="navbar">
      <div className="nav-container">
        <div className="nav-logo">
          <Link to="/" style={{ textDecoration: 'none', color: 'inherit' }}>
            <h2>🎯 {t('nav.logo')}</h2>
          </Link>
        </div>
        <div className="nav-links">
          <Link to="/" className={currentPage === 'home' ? 'active' : ''}>{t('nav.home')}</Link>
          <Link to="/servers" className={currentPage === 'servers' ? 'active' : ''}>{t('nav.servers')}</Link>
          <Link to="/blog" className={currentPage === 'blog' ? 'active' : ''}>{t('nav.blog')}</Link>
          <a href="https://git.cialloo.com" target="_blank" rel="noopener noreferrer" className={currentPage === 'git' ? 'active' : ''}>{t('nav.git')}</a>
          <Link to="/forum" className={currentPage === 'forum' ? 'active' : ''}>{t('nav.forum')}</Link>
          <Link to="/friends" className={currentPage === 'friends' ? 'active' : ''}>{t('nav.friends')}</Link>
          <ThemeToggle />
          <LanguageSelector />
          <button className="join-btn">{t('nav.joinNow')}</button>
        </div>
      </div>
    </nav>
  )
}

export default Nav