Add homework review link to admin sidebar

- Admin sidebar now has "ДЗ на проверку" link → /curator/homework
- Curator layout renders children-only for admin (no double sidebar)
- Active state highlights correctly when on /curator/* routes

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-07 14:18:56 +05:00
parent 543d5b2d5e
commit 9bc18247df
2 changed files with 8 additions and 1 deletions
+5
View File
@@ -9,6 +9,11 @@ export default async function CuratorLayout({ children }: { children: React.Reac
if (!session) redirect("/login");
if (session.user.role !== "curator" && session.user.role !== "admin") redirect("/dashboard");
// Admin uses their own layout — render content only
if (session.user.role === "admin") {
return <>{children}</>;
}
return (
<div className="min-h-screen flex" style={{ backgroundColor: "var(--background)" }}>
{/* Sidebar */}
+3 -1
View File
@@ -8,6 +8,7 @@ const links = [
{ href: "/admin/courses", label: "Курсы" },
{ href: "/admin/categories", label: "Категории" },
{ href: "/admin/users", label: "Пользователи" },
{ href: "/curator/homework", label: "ДЗ на проверку" },
];
export function AdminNav() {
@@ -18,7 +19,8 @@ export function AdminNav() {
{links.map(({ href, label }) => {
const active =
pathname === href ||
(href !== "/admin/dashboard" && pathname.startsWith(href));
(href !== "/admin/dashboard" && href !== "/curator/homework" && pathname.startsWith(href)) ||
(href === "/curator/homework" && pathname.startsWith("/curator"));
return (
<Link
key={href}