Spaces:
Sleeping
Sleeping
File size: 2,208 Bytes
d34aa41 4042397 d34aa41 eff5a0d 1812235 eff5a0d d34aa41 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | 'use client';
import Link from 'next/link';
import { usePathname } from 'next/navigation';
import { cn } from '@/lib/utils';
import { getVisibleNavItems, type AppRole } from './nav-items';
export function Sidebar({ role }: { role: AppRole }) {
const pathname = usePathname();
const items = getVisibleNavItems(role);
return (
<aside className="ajet-sidebar ajet-sidebar-desktop">
{/* Header */}
<div className="ajet-sidebar-head">
<div className="ajet-sidebar-logo" aria-hidden="true">
{/* eslint-disable-next-line @next/next/no-img-element */}
<img src="/brand/ajet-mark-white.png" alt="" />
</div>
<div className="ajet-sidebar-wordmark">
AJet <span>360</span>
</div>
</div>
{/* Nav */}
<nav className="ajet-sidebar-nav">
<div className="ajet-sidebar-section">Ana Modüller</div>
{items.map((item) => {
const Icon = item.icon;
const active =
pathname === item.href || (item.href !== '/' && pathname.startsWith(item.href));
return (
<Link
key={item.href}
href={item.href}
className={cn('ajet-nav-item', active && 'active')}
>
<Icon className="h-[16px] w-[16px] flex-shrink-0" />
{item.title}
</Link>
);
})}
</nav>
{/* Footer */}
<div className="ajet-sidebar-foot">
<div style={{ display: 'flex', alignItems: 'center', gap: 10 }}>
<div
style={{
width: 32,
height: 32,
borderRadius: 10,
background: 'var(--ajet-navy-700)',
color: '#fff',
display: 'grid',
placeItems: 'center',
fontWeight: 700,
fontSize: 12,
}}
>
AA
</div>
<div>
<div style={{ color: 'var(--dark-fg-2)', fontSize: 13, fontWeight: 600 }}>
AJet Admin
</div>
<div style={{ fontSize: 11 }}>admin@ajet.com.tr</div>
</div>
</div>
</div>
</aside>
);
}
|