Первый коммит
This commit is contained in:
46
src/components/Navigation.tsx
Normal file
46
src/components/Navigation.tsx
Normal file
@@ -0,0 +1,46 @@
|
||||
"use client";
|
||||
import Link from "next/link";
|
||||
import { usePathname } from "next/navigation";
|
||||
import styles from "../styles/navigation.module.css";
|
||||
|
||||
interface NavItem {
|
||||
id: string;
|
||||
label: string;
|
||||
href: string;
|
||||
}
|
||||
|
||||
const navItems: NavItem[] = [
|
||||
{ id: "home", label: "Дашборд", href: "/" },
|
||||
{ id: "stat", label: "Статистика", href: "/stat" },
|
||||
{ id: "billing", label: "Финансы", href: "/billing" },
|
||||
];
|
||||
|
||||
const Navigation: React.FC = () => {
|
||||
const pathname = usePathname();
|
||||
return (
|
||||
<nav className={styles.nav}>
|
||||
<div className={styles.logo}>RE:Premium Partner</div>
|
||||
<div className={styles.links}>
|
||||
{navItems.map((item) => (
|
||||
<Link
|
||||
key={item.id}
|
||||
href={item.href}
|
||||
className={
|
||||
pathname === item.href
|
||||
? styles.active
|
||||
: styles.link
|
||||
}
|
||||
>
|
||||
{item.label}
|
||||
</Link>
|
||||
))}
|
||||
</div>
|
||||
<div className={styles.profile}>
|
||||
<div className={styles.avatar}>ПП</div>
|
||||
<span className={styles.profileName}>Партнер RE:Premium</span>
|
||||
</div>
|
||||
</nav>
|
||||
);
|
||||
};
|
||||
|
||||
export default Navigation;
|
||||
Reference in New Issue
Block a user