()
| 7 | import { assets } from "@/assets/assets" |
| 8 | |
| 9 | const AdminSidebar = () => { |
| 10 | |
| 11 | const pathname = usePathname() |
| 12 | |
| 13 | const sidebarLinks = [ |
| 14 | { name: 'Dashboard', href: '/admin', icon: HomeIcon }, |
| 15 | { name: 'Stores', href: '/admin/stores', icon: StoreIcon }, |
| 16 | { name: 'Approve Store', href: '/admin/approve', icon: ShieldCheckIcon }, |
| 17 | { name: 'Coupons', href: '/admin/coupons', icon: TicketPercentIcon }, |
| 18 | ] |
| 19 | |
| 20 | return ( |
| 21 | <div className="inline-flex h-full flex-col gap-5 border-r border-slate-200 sm:min-w-60"> |
| 22 | <div className="flex flex-col gap-3 justify-center items-center pt-8 max-sm:hidden"> |
| 23 | <Image className="w-14 h-14 rounded-full" src={assets.gs_logo} alt="" width={80} height={80} /> |
| 24 | <p className="text-slate-700">Hi, GreatStack</p> |
| 25 | </div> |
| 26 | |
| 27 | <div className="max-sm:mt-6"> |
| 28 | { |
| 29 | sidebarLinks.map((link, index) => ( |
| 30 | <Link key={index} href={link.href} className={`relative flex items-center gap-3 text-slate-500 hover:bg-slate-50 p-2.5 transition ${pathname === link.href && 'bg-slate-100 sm:text-slate-600'}`}> |
| 31 | <link.icon size={18} className="sm:ml-5" /> |
| 32 | <p className="max-sm:hidden">{link.name}</p> |
| 33 | {pathname === link.href && <span className="absolute bg-green-500 right-0 top-1.5 bottom-1.5 w-1 sm:w-1.5 rounded-l"></span>} |
| 34 | </Link> |
| 35 | )) |
| 36 | } |
| 37 | </div> |
| 38 | </div> |
| 39 | ) |
| 40 | } |
| 41 | |
| 42 | export default AdminSidebar |
nothing calls this directly
no outgoing calls
no test coverage detected