diff --git a/app/rgpv/[branch]/page.tsx b/app/rgpv/[branch]/page.tsx index ee83660..077e31c 100644 --- a/app/rgpv/[branch]/page.tsx +++ b/app/rgpv/[branch]/page.tsx @@ -17,7 +17,7 @@ export default async function BranchPage({ params }: BranchPageProps) { const { branch } = await params; return ( -
+
); diff --git a/components/breadcrumbs.tsx b/components/breadcrumbs.tsx index c3e1516..4643ea0 100644 --- a/components/breadcrumbs.tsx +++ b/components/breadcrumbs.tsx @@ -2,7 +2,26 @@ import Link from "next/link"; import { usePathname } from "next/navigation"; -import { ChevronRight, Home } from "lucide-react"; +import { ChevronRight, Home, Sparkles } from "lucide-react"; + +// Mapping dictionary for acronyms and friendly branch/path names +const PATH_MAP: Record = { + rgpv: "RGPV", + common: "1st Year Common", + aiml: "AI & Machine Learning", + cse: "Computer Science", + csit: "CS & Information Tech", + aids: "AI & Data Science", + csbs: "CS & Business Systems", + cscy: "Cyber Security", + civil: "Civil Engineering", + me: "Mechanical Eng.", + ec: "ECE", + ee: "Electrical Eng.", + eee: "EEE", + ei: "Instrumentation", + ex: "Electronics Eng.", +}; export function Breadcrumbs() { const pathname = usePathname(); @@ -11,70 +30,70 @@ export function Breadcrumbs() { pathname ); - if (isWorkspaceFocusRoute) { + if (isWorkspaceFocusRoute || pathNames.length <= 1) { return null; } - if (pathNames.length <= 1) { - return null; - } + const formatSegment = (segment: string): string => { + const lower = segment.toLowerCase(); + if (PATH_MAP[lower]) return PATH_MAP[lower]; + + if (/^semester-\d+$/.test(lower)) { + const num = lower.replace("semester-", ""); + return `Semester ${num}`; + } + + return decodeURIComponent(segment) + .replace(/-/g, " ") + .replace(/\b\w/g, (char) => char.toUpperCase()); + }; return ( -
-