2026-02-05 18:36:19 +01:00
|
|
|
import { NavLink, Outlet } from 'react-router-dom'
|
|
|
|
|
|
|
|
|
|
const navItems = [
|
|
|
|
|
{ to: '/admin/games', label: 'Games' },
|
|
|
|
|
{ to: '/admin/pokemon', label: 'Pokemon' },
|
Improve admin panel UX with toasts, evolution CRUD, sorting, drag-and-drop, and responsive layout
Add sonner toast notifications to all mutations, evolution management backend
(CRUD endpoints with search/pagination) and frontend (form modal with pokemon
selector, paginated list page), sortable AdminTable columns (Region/Gen/Year
on Games), drag-and-drop route reordering via @dnd-kit, skeleton loading states,
card-styled table wrappers, and responsive mobile nav in AdminLayout.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 13:09:27 +01:00
|
|
|
{ to: '/admin/evolutions', label: 'Evolutions' },
|
2026-02-08 10:54:47 +01:00
|
|
|
{ to: '/admin/runs', label: 'Runs' },
|
2026-02-05 18:36:19 +01:00
|
|
|
]
|
|
|
|
|
|
|
|
|
|
export function AdminLayout() {
|
|
|
|
|
return (
|
|
|
|
|
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
|
|
|
|
|
<h1 className="text-2xl font-bold mb-6">Admin Panel</h1>
|
Improve admin panel UX with toasts, evolution CRUD, sorting, drag-and-drop, and responsive layout
Add sonner toast notifications to all mutations, evolution management backend
(CRUD endpoints with search/pagination) and frontend (form modal with pokemon
selector, paginated list page), sortable AdminTable columns (Region/Gen/Year
on Games), drag-and-drop route reordering via @dnd-kit, skeleton loading states,
card-styled table wrappers, and responsive mobile nav in AdminLayout.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 13:09:27 +01:00
|
|
|
<div className="flex flex-col sm:flex-row gap-6 sm:gap-8">
|
|
|
|
|
<nav className="flex-shrink-0 sm:w-48">
|
|
|
|
|
<ul className="flex sm:flex-col gap-1 overflow-x-auto sm:overflow-visible">
|
2026-02-05 18:36:19 +01:00
|
|
|
{navItems.map((item) => (
|
Improve admin panel UX with toasts, evolution CRUD, sorting, drag-and-drop, and responsive layout
Add sonner toast notifications to all mutations, evolution management backend
(CRUD endpoints with search/pagination) and frontend (form modal with pokemon
selector, paginated list page), sortable AdminTable columns (Region/Gen/Year
on Games), drag-and-drop route reordering via @dnd-kit, skeleton loading states,
card-styled table wrappers, and responsive mobile nav in AdminLayout.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 13:09:27 +01:00
|
|
|
<li key={item.to} className="flex-shrink-0">
|
2026-02-05 18:36:19 +01:00
|
|
|
<NavLink
|
|
|
|
|
to={item.to}
|
|
|
|
|
className={({ isActive }) =>
|
Improve admin panel UX with toasts, evolution CRUD, sorting, drag-and-drop, and responsive layout
Add sonner toast notifications to all mutations, evolution management backend
(CRUD endpoints with search/pagination) and frontend (form modal with pokemon
selector, paginated list page), sortable AdminTable columns (Region/Gen/Year
on Games), drag-and-drop route reordering via @dnd-kit, skeleton loading states,
card-styled table wrappers, and responsive mobile nav in AdminLayout.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 13:09:27 +01:00
|
|
|
`block px-3 py-2 rounded-md text-sm font-medium whitespace-nowrap ${
|
2026-02-05 18:36:19 +01:00
|
|
|
isActive
|
|
|
|
|
? 'bg-blue-100 text-blue-700 dark:bg-blue-900 dark:text-blue-200'
|
|
|
|
|
: 'hover:bg-gray-100 dark:hover:bg-gray-700'
|
|
|
|
|
}`
|
|
|
|
|
}
|
|
|
|
|
>
|
|
|
|
|
{item.label}
|
|
|
|
|
</NavLink>
|
|
|
|
|
</li>
|
|
|
|
|
))}
|
|
|
|
|
</ul>
|
|
|
|
|
</nav>
|
|
|
|
|
<div className="flex-1 min-w-0">
|
|
|
|
|
<Outlet />
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
|
}
|