Files
SIte/frontend/src/components/Sidebar.tsx
2025-09-23 15:24:40 +03:00

44 lines
1.4 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import Link from 'next/link'
import { usePathname } from 'next/navigation'
const menuItems = [
{ href: '/', label: 'Главная' },
{ href: '/publications', label: 'Новости и публикации' },
{ href: '/rid', label: 'РИД' },
{ href: '/staff', label: 'Сотрудники' },
{ href: '/projects', label: 'Проекты' },
{ href: '/students', label: 'Студентам' },
{ href: '/contacts', label: 'Контакты' },
]
export default function Sidebar() {
const pathname = usePathname()
return (
<aside className="w-64 bg-white shadow-sm border-r min-h-screen">
<div className="p-6">
<Link href="/" className="text-xl font-bold text-gray-900 block mb-8">
Отдел Радиофотоники
</Link>
<nav className="space-y-2">
{menuItems.map((item) => {
const isActive = pathname === item.href
return (
<Link
key={item.href}
href={item.href}
className={`block px-4 py-3 rounded-lg text-sm font-medium transition-colors ${
isActive
? 'bg-blue-50 text-blue-700 border-l-4 border-blue-700'
: 'text-gray-700 hover:bg-gray-50 hover:text-blue-600'
}`}
>
{item.label}
</Link>
)
})}
</nav>
</div>
</aside>
)
}