Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import React from 'react'
  2. import { Menu } from 'antd'
  3. import {
  4. HomeOutlined,
  5. MessageOutlined,
  6. UserOutlined,
  7. } from '@ant-design/icons'
  8. import { useRouter, usePathname } from 'next/navigation'
  9. const navItems = [
  10. {
  11. key: '/user/',
  12. icon: <HomeOutlined />,
  13. label: 'Home',
  14. },
  15. {
  16. key: '/user/chat',
  17. icon: <MessageOutlined />,
  18. label: 'Chat',
  19. },
  20. {
  21. key: '/user/profile',
  22. icon: <UserOutlined />,
  23. label: 'Profile',
  24. },
  25. ];
  26. const Navigation = () => {
  27. const router = useRouter()
  28. const pathname = usePathname()
  29. return (
  30. <Menu
  31. mode="horizontal"
  32. selectedKeys={[pathname]}
  33. onClick={({ key }) => router.push(key)}
  34. items={navItems}
  35. className="custom-center-menu"
  36. />
  37. )
  38. }
  39. export default Navigation