Files
Aut.ManagementFaculty/src/app/professional/layout.tsx
T
smhk1376andCursor 2b0db26a93
Deploy edu.mstaut.ir / deploy (push) Has been cancelled
Ship site UI checklist, move admin to /mstcontroller, and add safe taxonomy label migration.
Production already has migrations through 008; 009 only updates four seed labels by id. Faculty sync remains upsert-by-email/name and does not wipe curated data.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-16 16:26:21 +03:30

72 lines
2.1 KiB
TypeScript

import { getTranslations } from "next-intl/server";
import { SiteFooter } from "@/components/organisms/SiteFooter";
import { SiteHeader } from "@/components/organisms/SiteHeader";
import { buildCourseNavChildren } from "@/lib/course-nav";
import { getCourses } from "@/lib/data/courses";
import { listPublishedCourseTags } from "@/lib/data/taxonomy";
import { getPrograms } from "@/lib/data/programs";
import {
courseNavParentTag,
facultySiteUrl,
professionalNav,
siteShortName,
} from "@/lib/site-config";
export const dynamic = "force-dynamic";
export default async function ProfessionalLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
const t = await getTranslations();
const year = new Date().getFullYear();
let courses: Awaited<ReturnType<typeof getCourses>> = [];
let programs: Awaited<ReturnType<typeof getPrograms>> = [];
let navTags: Awaited<ReturnType<typeof listPublishedCourseTags>> = [];
try {
[courses, programs, navTags] = await Promise.all([
getCourses(),
getPrograms(),
listPublishedCourseTags({ navOnly: true }),
]);
} catch (err) {
console.error("[professional/layout] CMS fetch failed:", err);
}
const navItems = professionalNav.map((item) =>
item.label === courseNavParentTag
? {
...item,
children: buildCourseNavChildren(navTags),
}
: item,
);
return (
<>
<SiteHeader
items={navItems}
searchLabel={t("nav.search")}
contactLabel={t("nav.contact")}
brandTitle={siteShortName}
brandSubtitle={t("nav.brandSubtitle")}
variant="professional"
courses={courses}
programs={programs}
/>
<div className="min-w-0 flex-1 overflow-x-clip">{children}</div>
<SiteFooter
variant="professional"
copyright={t("footer.copyright", { year })}
linksTitle={t("footer.links")}
links={[
{ label: t("footer.facultySite"), href: facultySiteUrl },
{ label: t("footer.press"), href: "/press" },
{ label: t("footer.careers"), href: "/careers" },
]}
/>
</>
);
}