From ce0ffd0ccc360ba54ba450a603c7ab56100c0bc8 Mon Sep 17 00:00:00 2001 From: Bianca Date: Tue, 15 Sep 2026 10:52:39 +0200 Subject: [PATCH 1/3] feat: refactor group components to use wizard constants and improve structure --- .../[school]/[level]/[course]/page.tsx | 2 +- .../didattica/[school]/[level]/page.tsx | 13 ++++--- src/app/groups/didattica/[school]/page.tsx | 9 +++-- src/app/groups/didattica/page.tsx | 7 ++-- src/components/groups/groups-result.tsx | 36 ++++++++++--------- .../groups/report/missing-link/index.tsx | 2 +- .../groups/report/missing-link/level-step.tsx | 2 +- .../report/missing-link/school-step.tsx | 2 +- .../{groups => wizard}/constants.ts | 2 +- .../{groups => wizard}/course-filters.tsx | 0 .../{groups => wizard}/course-step.tsx | 13 ++++--- .../{groups => wizard}/level-step.tsx | 17 ++++++--- .../{groups => wizard}/school-step.tsx | 21 +++++++---- src/components/{groups => wizard}/types.ts | 0 .../{groups => wizard}/wizard-shell.tsx | 4 ++- src/utils/step-href.ts | 10 ++++-- 16 files changed, 91 insertions(+), 49 deletions(-) rename src/components/{groups => wizard}/constants.ts (96%) rename src/components/{groups => wizard}/course-filters.tsx (100%) rename src/components/{groups => wizard}/course-step.tsx (88%) rename src/components/{groups => wizard}/level-step.tsx (74%) rename src/components/{groups => wizard}/school-step.tsx (61%) rename src/components/{groups => wizard}/types.ts (100%) rename src/components/{groups => wizard}/wizard-shell.tsx (97%) diff --git a/src/app/groups/didattica/[school]/[level]/[course]/page.tsx b/src/app/groups/didattica/[school]/[level]/[course]/page.tsx index 2e86add..d03fdaa 100644 --- a/src/app/groups/didattica/[school]/[level]/[course]/page.tsx +++ b/src/app/groups/didattica/[school]/[level]/[course]/page.tsx @@ -1,6 +1,6 @@ import type { Metadata } from "next" -import { getLevel, getSchool } from "@/components/groups/constants" import { GroupsResult } from "@/components/groups/groups-result" +import { getLevel, getSchool } from "@/components/wizard/constants" import { humanizeSlug } from "@/utils/labels" export const dynamic = "force-dynamic" diff --git a/src/app/groups/didattica/[school]/[level]/page.tsx b/src/app/groups/didattica/[school]/[level]/page.tsx index 3006541..4475adb 100644 --- a/src/app/groups/didattica/[school]/[level]/page.tsx +++ b/src/app/groups/didattica/[school]/[level]/page.tsx @@ -1,10 +1,13 @@ import type { Metadata } from "next" -import { getLevel, getSchool } from "@/components/groups/constants" -import { CourseStep } from "@/components/groups/course-step" -import type { CourseSearchParams } from "@/components/groups/types" +import { getLevel, getSchool } from "@/components/wizard/constants" +import { CourseStep } from "@/components/wizard/course-step" +import type { CourseSearchParams } from "@/components/wizard/types" +import { createStepHref } from "@/utils/step-href" export const dynamic = "force-dynamic" +const stepHref = createStepHref("/groups/didattica") + export async function generateMetadata({ params, }: { @@ -30,5 +33,7 @@ export default async function DidatticaCoursePage({ }) { const { school, level } = await params const { campus, lang } = await searchParams - return + return ( + + ) } diff --git a/src/app/groups/didattica/[school]/page.tsx b/src/app/groups/didattica/[school]/page.tsx index a059eb3..cfd12ff 100644 --- a/src/app/groups/didattica/[school]/page.tsx +++ b/src/app/groups/didattica/[school]/page.tsx @@ -1,6 +1,9 @@ import type { Metadata } from "next" -import { getSchool } from "@/components/groups/constants" -import { LevelStep } from "@/components/groups/level-step" +import { getSchool } from "@/components/wizard/constants" +import { LevelStep } from "@/components/wizard/level-step" +import { createStepHref } from "@/utils/step-href" + +const stepHref = createStepHref("/groups/didattica") export async function generateMetadata({ params }: { params: Promise<{ school: string }> }): Promise { const { school: schoolSlug } = await params @@ -15,5 +18,5 @@ export async function generateMetadata({ params }: { params: Promise<{ school: s export default async function DidatticaLevelPage({ params }: { params: Promise<{ school: string }> }) { const { school } = await params - return + return } diff --git a/src/app/groups/didattica/page.tsx b/src/app/groups/didattica/page.tsx index 58d6cfe..7514ed3 100644 --- a/src/app/groups/didattica/page.tsx +++ b/src/app/groups/didattica/page.tsx @@ -1,5 +1,8 @@ import type { Metadata } from "next" -import { SchoolStep } from "@/components/groups/school-step" +import { SchoolStep } from "@/components/wizard/school-step" +import { createStepHref } from "@/utils/step-href" + +const stepHref = createStepHref("/groups/didattica") export const metadata: Metadata = { title: "Gruppi Didattici", @@ -7,5 +10,5 @@ export const metadata: Metadata = { } export default function DidatticaWizard() { - return + return } diff --git a/src/components/groups/groups-result.tsx b/src/components/groups/groups-result.tsx index ba15d7f..eb631f9 100644 --- a/src/components/groups/groups-result.tsx +++ b/src/components/groups/groups-result.tsx @@ -2,7 +2,7 @@ import Link from "next/link" import { notFound } from "next/navigation" import { FiArrowLeft, FiX } from "react-icons/fi" import { CardCourseGroup } from "@/components/card-course-group" -import { getLevel, getSchool } from "@/components/groups/constants" +import { getLevel, getSchool } from "@/components/wizard/constants" import { getVisibleGroups } from "@/queries/groups" import type { VisibleGroup } from "@/queries/types" import { @@ -17,7 +17,9 @@ import { schoolLabel, } from "@/utils/labels" import { mergeGroupsByTitle } from "@/utils/merge-groups" -import { stepHref } from "../../utils/step-href" +import { createStepHref } from "@/utils/step-href" + +const stepHref = createStepHref("/groups/didattica") function GroupSection({ title, groups }: { title: string; groups: VisibleGroup[] }) { const merged = mergeGroupsByTitle(groups) @@ -114,21 +116,21 @@ export async function GroupsResult({ mergedSchoolGroups.length > 0 || mergedLevelGroups.length > 0 || mergedGeneralCourseGroups.length > 0) && ( -
- {mergedSiteGroups.map((g) => ( - - ))} - {mergedSchoolGroups.map((g) => ( - - ))} - {mergedLevelGroups.map((g) => ( - - ))} - {mergedGeneralCourseGroups.map((g) => ( - - ))} -
- )} +
+ {mergedSiteGroups.map((g) => ( + + ))} + {mergedSchoolGroups.map((g) => ( + + ))} + {mergedLevelGroups.map((g) => ( + + ))} + {mergedGeneralCourseGroups.map((g) => ( + + ))} +
+ )} {cohorts.map((cohort) => ( void; onSelect: (schoolSlug: string) => void }) { return ( diff --git a/src/components/groups/constants.ts b/src/components/wizard/constants.ts similarity index 96% rename from src/components/groups/constants.ts rename to src/components/wizard/constants.ts index a2e702a..2bdcaba 100644 --- a/src/components/groups/constants.ts +++ b/src/components/wizard/constants.ts @@ -1,6 +1,6 @@ import { FiBox } from "react-icons/fi" import type { GradientIconType } from "@/components/gradient-icon" -import type { Level, School } from "@/components/groups/types" +import type { Level, School } from "@/components/wizard/types" export const SCHOOLS: School[] = [ { slug: "ingegneria-industriale-informazione", name: "Scuola di Ingegneria Industriale e dell'Informazione" }, diff --git a/src/components/groups/course-filters.tsx b/src/components/wizard/course-filters.tsx similarity index 100% rename from src/components/groups/course-filters.tsx rename to src/components/wizard/course-filters.tsx diff --git a/src/components/groups/course-step.tsx b/src/components/wizard/course-step.tsx similarity index 88% rename from src/components/groups/course-step.tsx rename to src/components/wizard/course-step.tsx index 164a829..5f18764 100644 --- a/src/components/groups/course-step.tsx +++ b/src/components/wizard/course-step.tsx @@ -2,9 +2,9 @@ import Link from "next/link" import { notFound } from "next/navigation" import { FiChevronRight } from "react-icons/fi" import { CardCourse } from "@/components/card-course" -import { getLevel, getSchool } from "@/components/groups/constants" -import { CourseFilters, type FilterOption } from "@/components/groups/course-filters" -import { WizardShell } from "@/components/groups/wizard-shell" +import { getLevel, getSchool } from "@/components/wizard/constants" +import { CourseFilters, type FilterOption } from "@/components/wizard/course-filters" +import { WizardShell } from "@/components/wizard/wizard-shell" import { getVisibleGroups } from "@/queries/groups" import { CAMPUS_FACETS, @@ -16,7 +16,7 @@ import { languageFacet, languageLabel, } from "@/utils/labels" -import { stepHref } from "../../utils/step-href" +import type { StepHrefBuilder } from "@/utils/step-href" function facetOptions(facetsByCourse: Map, known: string[], label: (facet: string) => string) { const values = new Set() @@ -33,11 +33,15 @@ export async function CourseStep({ level, campus, lang, + landingHref, + stepHref, }: { school: string level: string campus?: string lang?: string + landingHref: string + stepHref: StepHrefBuilder }) { const school = getSchool(schoolSlug) const currentLevel = getLevel(schoolSlug, level) @@ -64,6 +68,7 @@ export async function CourseStep({ caption={`Perfetto, cerchiamo tra i corsi della ${currentLevel.name.toLowerCase()}!`} captionPosition="above" backHref={stepHref({ school: schoolSlug })} + closeHref={landingHref} action={ campusOptions.length > 0 || languageOptions.length > 0 ? ( diff --git a/src/components/groups/level-step.tsx b/src/components/wizard/level-step.tsx similarity index 74% rename from src/components/groups/level-step.tsx rename to src/components/wizard/level-step.tsx index 35150a4..e40c958 100644 --- a/src/components/groups/level-step.tsx +++ b/src/components/wizard/level-step.tsx @@ -2,12 +2,20 @@ import Link from "next/link" import { notFound } from "next/navigation" import { FiBook } from "react-icons/fi" import { CardPathSelection } from "@/components/card-path-selection" -import { getLevelsForSchool, getSchool } from "@/components/groups/constants" -import { WizardShell } from "@/components/groups/wizard-shell" +import { getLevelsForSchool, getSchool } from "@/components/wizard/constants" +import { WizardShell } from "@/components/wizard/wizard-shell" import { cn } from "@/lib/utils" -import { stepHref } from "../../utils/step-href" +import type { StepHrefBuilder } from "@/utils/step-href" -export function LevelStep({ school: schoolSlug }: { school: string }) { +export function LevelStep({ + school: schoolSlug, + landingHref, + stepHref, +}: { + school: string + landingHref: string + stepHref: StepHrefBuilder +}) { const school = getSchool(schoolSlug) if (!school) notFound() @@ -20,6 +28,7 @@ export function LevelStep({ school: schoolSlug }: { school: string }) { caption={`Ottimo, ${school.name}!`} captionPosition="above" backHref={stepHref({})} + closeHref={landingHref} >
{levels.map((level, index) => { diff --git a/src/components/groups/school-step.tsx b/src/components/wizard/school-step.tsx similarity index 61% rename from src/components/groups/school-step.tsx rename to src/components/wizard/school-step.tsx index a25bb1e..4c1fa76 100644 --- a/src/components/groups/school-step.tsx +++ b/src/components/wizard/school-step.tsx @@ -1,15 +1,24 @@ import { CardIcon } from "@/components/card-icon" -import { DEFAULT_SCHOOL_ICON, SCHOOL_ICONS, SCHOOLS } from "@/components/groups/constants" -import { WizardShell } from "@/components/groups/wizard-shell" -import { stepHref } from "../../utils/step-href" +import { DEFAULT_SCHOOL_ICON, SCHOOL_ICONS, SCHOOLS } from "@/components/wizard/constants" +import { WizardShell } from "@/components/wizard/wizard-shell" +import type { StepHrefBuilder } from "@/utils/step-href" -export function SchoolStep() { +export function SchoolStep({ + caption, + landingHref, + stepHref, +}: { + caption: string + landingHref: string + stepHref: StepHrefBuilder +}) { return (
{SCHOOLS.map((school) => ( diff --git a/src/components/groups/types.ts b/src/components/wizard/types.ts similarity index 100% rename from src/components/groups/types.ts rename to src/components/wizard/types.ts diff --git a/src/components/groups/wizard-shell.tsx b/src/components/wizard/wizard-shell.tsx similarity index 97% rename from src/components/groups/wizard-shell.tsx rename to src/components/wizard/wizard-shell.tsx index fcb4b08..f4adad5 100644 --- a/src/components/groups/wizard-shell.tsx +++ b/src/components/wizard/wizard-shell.tsx @@ -15,6 +15,7 @@ type WizardShellProps = { caption?: string captionPosition?: "above" | "below" backHref?: string + closeHref?: string action?: ReactNode children: ReactNode } @@ -25,6 +26,7 @@ export function WizardShell({ caption, captionPosition = "below", backHref, + closeHref = "/groups", action, children, }: WizardShellProps) { @@ -64,7 +66,7 @@ export function WizardShell({ iconClassName="size-5" className="md:rounded-full md:bg-white/60 md:backdrop-blur-none" aria-label="Chiudi" - onClick={() => router.push("/groups")} + onClick={() => router.push(closeHref)} />
diff --git a/src/utils/step-href.ts b/src/utils/step-href.ts index bcb6949..6a8aa03 100644 --- a/src/utils/step-href.ts +++ b/src/utils/step-href.ts @@ -1,4 +1,8 @@ -export function stepHref(params: { school?: string; level?: string; course?: string }) { - const segments = [params.school, params.level, params.course].filter(Boolean) - return ["/groups/didattica", ...segments].join("/") +export type StepHrefBuilder = (params: { school?: string; level?: string; course?: string }) => string + +export function createStepHref(basePath: string): StepHrefBuilder { + return (params) => { + const segments = [params.school, params.level, params.course].filter(Boolean) + return [basePath, ...segments].join("/") + } } From 9596cddaf11d0ffff51b432325c16844fb3c2de5 Mon Sep 17 00:00:00 2001 From: Bianca Date: Tue, 15 Sep 2026 11:08:34 +0200 Subject: [PATCH 2/3] feat: add guides structure and components for course navigation --- .../corso/[school]/[level]/[course]/page.tsx | 33 ++++++++++ .../guides/corso/[school]/[level]/page.tsx | 39 +++++++++++ src/app/guides/corso/[school]/page.tsx | 22 +++++++ src/app/guides/corso/page.tsx | 14 ++++ src/app/guides/generali/page.tsx | 11 ++++ src/app/guides/page.tsx | 55 ++++++++++++++++ src/components/guides/constants.ts | 26 ++++++++ src/components/guides/general-guides.tsx | 39 +++++++++++ src/components/guides/guides-result.tsx | 66 +++++++++++++++++++ 9 files changed, 305 insertions(+) create mode 100644 src/app/guides/corso/[school]/[level]/[course]/page.tsx create mode 100644 src/app/guides/corso/[school]/[level]/page.tsx create mode 100644 src/app/guides/corso/[school]/page.tsx create mode 100644 src/app/guides/corso/page.tsx create mode 100644 src/app/guides/generali/page.tsx create mode 100644 src/app/guides/page.tsx create mode 100644 src/components/guides/constants.ts create mode 100644 src/components/guides/general-guides.tsx create mode 100644 src/components/guides/guides-result.tsx diff --git a/src/app/guides/corso/[school]/[level]/[course]/page.tsx b/src/app/guides/corso/[school]/[level]/[course]/page.tsx new file mode 100644 index 0000000..8f2027d --- /dev/null +++ b/src/app/guides/corso/[school]/[level]/[course]/page.tsx @@ -0,0 +1,33 @@ +import type { Metadata } from "next" +import { GuidesResult } from "@/components/guides/guides-result" +import { getLevel, getSchool } from "@/components/wizard/constants" +import { humanizeSlug } from "@/utils/labels" + +export const dynamic = "force-dynamic" + +export async function generateMetadata({ + params, +}: { + params: Promise<{ school: string; level: string; course: string }> +}): Promise { + const { school: schoolSlug, level: levelSlug, course } = await params + const school = getSchool(schoolSlug) + const level = getLevel(schoolSlug, levelSlug) + if (!school || !level) return {} + + const courseName = humanizeSlug(course) + + return { + title: `${courseName} - Guide`, + description: `Guide per ${courseName}, ${level.name} alla ${school.name}.`, + } +} + +export default async function GuidesResultPage({ + params, +}: { + params: Promise<{ school: string; level: string; course: string }> +}) { + const { school, level, course } = await params + return +} diff --git a/src/app/guides/corso/[school]/[level]/page.tsx b/src/app/guides/corso/[school]/[level]/page.tsx new file mode 100644 index 0000000..3f92225 --- /dev/null +++ b/src/app/guides/corso/[school]/[level]/page.tsx @@ -0,0 +1,39 @@ +import type { Metadata } from "next" +import { getLevel, getSchool } from "@/components/wizard/constants" +import { CourseStep } from "@/components/wizard/course-step" +import type { CourseSearchParams } from "@/components/wizard/types" +import { createStepHref } from "@/utils/step-href" + +export const dynamic = "force-dynamic" + +const stepHref = createStepHref("/guides/corso") + +export async function generateMetadata({ + params, +}: { + params: Promise<{ school: string; level: string }> +}): Promise { + const { school: schoolSlug, level: levelSlug } = await params + const school = getSchool(schoolSlug) + const level = getLevel(schoolSlug, levelSlug) + if (!school || !level) return {} + + return { + title: `${level.name} - ${school.name}`, + description: `Trova le guide del tuo corso di ${level.name.toLowerCase()} alla ${school.name}.`, + } +} + +export default async function GuidesCoursePage({ + params, + searchParams, +}: { + params: Promise<{ school: string; level: string }> + searchParams: Promise +}) { + const { school, level } = await params + const { campus, lang } = await searchParams + return ( + + ) +} diff --git a/src/app/guides/corso/[school]/page.tsx b/src/app/guides/corso/[school]/page.tsx new file mode 100644 index 0000000..47ae100 --- /dev/null +++ b/src/app/guides/corso/[school]/page.tsx @@ -0,0 +1,22 @@ +import type { Metadata } from "next" +import { getSchool } from "@/components/wizard/constants" +import { LevelStep } from "@/components/wizard/level-step" +import { createStepHref } from "@/utils/step-href" + +const stepHref = createStepHref("/guides/corso") + +export async function generateMetadata({ params }: { params: Promise<{ school: string }> }): Promise { + const { school: schoolSlug } = await params + const school = getSchool(schoolSlug) + if (!school) return {} + + return { + title: school.name, + description: `Trova le guide della ${school.name}.`, + } +} + +export default async function GuidesLevelPage({ params }: { params: Promise<{ school: string }> }) { + const { school } = await params + return +} diff --git a/src/app/guides/corso/page.tsx b/src/app/guides/corso/page.tsx new file mode 100644 index 0000000..a5834f6 --- /dev/null +++ b/src/app/guides/corso/page.tsx @@ -0,0 +1,14 @@ +import type { Metadata } from "next" +import { SchoolStep } from "@/components/wizard/school-step" +import { createStepHref } from "@/utils/step-href" + +const stepHref = createStepHref("/guides/corso") + +export const metadata: Metadata = { + title: "Guide del tuo Corso", + description: "Trova le guide del tuo corso di studi, partendo dalla tua scuola.", +} + +export default function GuidesCorsoWizard() { + return +} diff --git a/src/app/guides/generali/page.tsx b/src/app/guides/generali/page.tsx new file mode 100644 index 0000000..a4aac90 --- /dev/null +++ b/src/app/guides/generali/page.tsx @@ -0,0 +1,11 @@ +import type { Metadata } from "next" +import { GeneralGuides } from "@/components/guides/general-guides" + +export const metadata: Metadata = { + title: "Guide Generali", + description: "Le guide generali del Politecnico di Milano.", +} + +export default function GuidesGeneraliPage() { + return +} diff --git a/src/app/guides/page.tsx b/src/app/guides/page.tsx new file mode 100644 index 0000000..e9d039f --- /dev/null +++ b/src/app/guides/page.tsx @@ -0,0 +1,55 @@ +import type { Metadata } from "next" +import { FiBook, FiFileText } from "react-icons/fi" +import { CardIcon } from "@/components/card-icon" + +const guides = [ + { + title: "Guide Generali", + caption: "Informazioni utili su segreterie, servizi, immatricolazione e vita al Politecnico.", + href: "/guides/generali", + icon: FiFileText, + cta: "Esplora", + }, + { + title: "Guide del tuo Corso", + caption: "Piani di studio, esami e tutto ciò che riguarda il tuo corso di studi.", + href: "/guides/corso", + icon: FiBook, + cta: "Inizia", + }, +] as const + +export const metadata: Metadata = { + title: "Guide", + description: "Esplora le guide del Politecnico di Milano, da quelle generali a quelle del tuo corso di studi.", +} + +export default function GuidesHome() { + return ( +
+
+
+

+ Guide +

+
+ +
+ {guides.map((guide) => ( + + ))} +
+
+
+ ) +} diff --git a/src/components/guides/constants.ts b/src/components/guides/constants.ts new file mode 100644 index 0000000..742951e --- /dev/null +++ b/src/components/guides/constants.ts @@ -0,0 +1,26 @@ +export const LOREM_GUIDES = [ + { + value: "lorem-ipsum-dolor-sit-amet", + trigger: "Lorem ipsum dolor sit amet", + content: + "Consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.", + }, + { + value: "ut-enim-ad-minim-veniam", + trigger: "Ut enim ad minim veniam", + content: + "Quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium.", + }, + { + value: "duis-aute-irure-dolor", + trigger: "Duis aute irure dolor", + content: + "In reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt.", + }, + { + value: "excepteur-sint-occaecat", + trigger: "Excepteur sint occaecat", + content: + "Cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt.", + }, +] diff --git a/src/components/guides/general-guides.tsx b/src/components/guides/general-guides.tsx new file mode 100644 index 0000000..48b6290 --- /dev/null +++ b/src/components/guides/general-guides.tsx @@ -0,0 +1,39 @@ +import Link from "next/link" +import { FiArrowLeft, FiX } from "react-icons/fi" +import AccordionList from "@/components/accordion-list" +import { LOREM_GUIDES } from "@/components/guides/constants" + +export function GeneralGuides() { + return ( +
+
+ + + +
+

Guide Generali

+
+ + + +
+ + {LOREM_GUIDES.length > 0 ? ( + + ) : ( +

+ Nessuna guida disponibile al momento. +

+ )} +
+ ) +} diff --git a/src/components/guides/guides-result.tsx b/src/components/guides/guides-result.tsx new file mode 100644 index 0000000..bf98f20 --- /dev/null +++ b/src/components/guides/guides-result.tsx @@ -0,0 +1,66 @@ +import Link from "next/link" +import { notFound } from "next/navigation" +import { FiArrowLeft, FiX } from "react-icons/fi" +import AccordionList from "@/components/accordion-list" +import { LOREM_GUIDES } from "@/components/guides/constants" +import { getLevel, getSchool } from "@/components/wizard/constants" +import { getVisibleGroups } from "@/queries/groups" +import { courseFacetsForLevel, humanizeSlug } from "@/utils/labels" +import { createStepHref } from "@/utils/step-href" + +const stepHref = createStepHref("/guides/corso") + +export async function GuidesResult({ + school: schoolSlug, + level, + course, +}: { + school: string + level: string + course: string +}) { + const school = getSchool(schoolSlug) + const currentLevel = getLevel(schoolSlug, level) + if (!school || !currentLevel) notFound() + + const groups = await getVisibleGroups() + if (!courseFacetsForLevel(groups, schoolSlug, level).has(course)) notFound() + + const courseName = humanizeSlug(course) + + return ( +
+
+ + + +
+

{courseName}

+

+ Laurea {currentLevel.name} +

+
+ + + +
+ + {LOREM_GUIDES.length > 0 ? ( + + ) : ( +

+ Nessuna guida disponibile al momento per questo corso. +

+ )} +
+ ) +} From 967a3b2c796542dfc92a149a1486af975937b532 Mon Sep 17 00:00:00 2001 From: Bianca Date: Tue, 15 Sep 2026 11:10:01 +0200 Subject: [PATCH 3/3] fix: biome --- src/components/groups/groups-result.tsx | 30 ++++++++++++------------- src/components/home/hero.tsx | 2 +- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/components/groups/groups-result.tsx b/src/components/groups/groups-result.tsx index eb631f9..4b55799 100644 --- a/src/components/groups/groups-result.tsx +++ b/src/components/groups/groups-result.tsx @@ -116,21 +116,21 @@ export async function GroupsResult({ mergedSchoolGroups.length > 0 || mergedLevelGroups.length > 0 || mergedGeneralCourseGroups.length > 0) && ( -
- {mergedSiteGroups.map((g) => ( - - ))} - {mergedSchoolGroups.map((g) => ( - - ))} - {mergedLevelGroups.map((g) => ( - - ))} - {mergedGeneralCourseGroups.map((g) => ( - - ))} -
- )} +
+ {mergedSiteGroups.map((g) => ( + + ))} + {mergedSchoolGroups.map((g) => ( + + ))} + {mergedLevelGroups.map((g) => ( + + ))} + {mergedGeneralCourseGroups.map((g) => ( + + ))} +
+ )} {cohorts.map((cohort) => ( -
+

Trova gruppi, risorse e supporto tra gli studenti del Polimi