diff --git a/app/components/subjects.tsx b/app/components/subjects.tsx index 588c63a..db26ad3 100644 --- a/app/components/subjects.tsx +++ b/app/components/subjects.tsx @@ -1,195 +1,117 @@ -"use client"; -import Link from "next/link"; +'use client'; +import Link from 'next/link'; const subjects = { - "Semester-1": [ - "Basic Electrical and Electronics", - "Basics of Mechanical Engineering", - "C Programming", - "Engineering Mathematics-1", - "Engineering Physics", - "Engineering Graphics & Design", - "English Communication", - ], - "Semester-2": [ - "Digital Electronics & Logic Circuits", - "OOPs with Java", - "Engineering Mathematics-2", - "Data Structures using C", - "Modern Biology", - "Environmental Studies", - ], - "Semester-3": [ - "Problem Solving using Python", - "Data Science using Python Libraries", - "Computer Organization & Architecture", - "Probability & Statistics", - "Theory of Computation", - "Information Technology", - "Technical Writing", - ], - "Semester-4": [ - "Discrete Mathematics", - "Computer Networks", - "Database Management Systems", - "Operating Systems", - "Web Technologies", - "DevOps & Linux Administration", - "Organizational Behavior", - ], - "Semester-5": [ - "Artificial Intelligence", - "Algorithm Design and Analysis", - "Cloud Computing", - "Economics for Engineers", - "IoT (Internet of Things)", - "Compiler Design", - "Cyber Laws and Ethics", - "Cryptography & Network Security", - ], - "Semester-6": [ - "Machine Learning", - "Natural Language Processing", - "Deep Learning", - "Computer Vision and Image Processing", - "Blockchain Technology", - "Information Retrieval", - "Management Information Systems", - ], - "Semester-7": [ - "VLSI and Embedded Systems", - "Entrepreneurship & Startup", - "Financial Management", - "Robotic Access Automation", - "Marketing Management", - "Big-data Analytics", - "Decision Sciences", - ], - "Semester-8": [ - "Software Engineering", - ], + 'Semester-1': ['Basic Electrical and Electronics', 'Basics of Mechanical Engineering', 'C Programming', 'Engineering Mathematics-1', 'Engineering Physics', 'Engineering Graphics & Design', 'English Communication'], + 'Semester-2': ['Digital Electronics & Logic Circuits', 'OOPs with Java', 'Engineering Mathematics-2', 'Data Structures using C', 'Modern Biology', 'Environmental Studies'], + 'Semester-3': ['Problem Solving using Python', 'Data Science using Python Libraries', 'Computer Organization & Architecture', 'Probability & Statistics', 'Theory of Computation', 'Information Technology', 'Technical Writing'], + 'Semester-4': ['Discrete Mathematics', 'Computer Networks', 'Database Management Systems', 'Operating Systems', 'Web Technologies', 'DevOps & Linux Administration', 'Organizational Behavior'], + 'Semester-5': ['Artificial Intelligence', 'Algorithm Design and Analysis', 'Cloud Computing', 'Economics for Engineers', 'IoT (Internet of Things)', 'Compiler Design', 'Cyber Laws and Ethics', 'Cryptography & Network Security'], + 'Semester-6': ['Machine Learning', 'Natural Language Processing', 'Deep Learning', 'Computer Vision and Image Processing', 'Blockchain Technology', 'Information Retrieval', 'Management Information Systems'], + 'Semester-7': ['VLSI and Embedded Systems', 'Entrepreneurship & Startup', 'Financial Management', 'Robotic Access Automation', 'Marketing Management', 'Big-data Analytics', 'Decision Sciences'], + 'Semester-8': ['Software Engineering'], }; // Short codes for subjects const subjectCodes: Record = { - "Basic Electrical and Electronics": "bee", - "C Programming": "c", - "Engineering Mathematics-1": "em1", - "Engineering Physics": "ep", - "Engineering Graphics & Design": "egd", - "English Communication": "ec", - "Basics of Mechanical Engineering": "bme", + 'Basic Electrical and Electronics': 'bee', + 'C Programming': 'c', + 'Engineering Mathematics-1': 'em1', + 'Engineering Physics': 'ep', + 'Engineering Graphics & Design': 'egd', + 'English Communication': 'ec', + 'Basics of Mechanical Engineering': 'bme', - "Digital Electronics & Logic Circuits": "delc", - "OOPs with Java": "oops", - "Engineering Mathematics-2": "em2", - "Data Structures using C": "dsc", - "Modern Biology": "mb", - "Environmental Studies": "es", + 'Digital Electronics & Logic Circuits': 'delc', + 'OOPs with Java': 'oops', + 'Engineering Mathematics-2': 'em2', + 'Data Structures using C': 'dsc', + 'Modern Biology': 'mb', + 'Environmental Studies': 'es', - "Problem Solving using Python": "py", - "Computer Organization & Architecture": "coa", - "Probability & Statistics": "ps", - "Theory of Computation": "toc", - "Information Technology": "it", - "Technical Writing": "tw", + 'Problem Solving using Python': 'py', + 'Computer Organization & Architecture': 'coa', + 'Probability & Statistics': 'ps', + 'Theory of Computation': 'toc', + 'Information Technology': 'it', + 'Technical Writing': 'tw', - "Computer Networks": "cn", - "Database Management Systems": "dbms", - "Operating Systems": "os", - "Web Technologies": "wt", - "DevOps & Linux Administration": "dops", - "Organizational Behavior": "ob", - "Discrete Mathematics": "dm", + 'Computer Networks': 'cn', + 'Database Management Systems': 'dbms', + 'Operating Systems': 'os', + 'Web Technologies': 'wt', + 'DevOps & Linux Administration': 'dops', + 'Organizational Behavior': 'ob', + 'Discrete Mathematics': 'dm', - "Data Science using Python Libraries": "dsp", - "Artificial Intelligence": "ai", - "Algorithm Design and Analysis": "ada", - "Cloud Computing": "cc", - "Economics for Engineers": "ee", - "IoT (Internet of Things)": "iot", - "Compiler Design": "cd", - "Cyber Laws and Ethics": "cle", - "Cryptography & Network Security": "cns", - "Machine Learning": "ml", - "Natural Language Processing": "nlp", - "Deep Learning": "dl", - "Computer Vision and Image Processing": "cvip", - "Blockchain Technology": "bt", - "Information Retrieval": "ir", - "Management Information Systems": "mis", - "VLSI and Embedded Systems": "vlsi", - "Entrepreneurship & Startup": "es", - "Financial Management": "fm", - "Robotic Access Automation": "raa", - "Marketing Management": "mm", - "Big-data Analytics": "bda", - "Decision Sciences": "des", - "Software Engineering": "se", + 'Data Science using Python Libraries': 'dsp', + 'Artificial Intelligence': 'ai', + 'Algorithm Design and Analysis': 'ada', + 'Cloud Computing': 'cc', + 'Economics for Engineers': 'ee', + 'IoT (Internet of Things)': 'iot', + 'Compiler Design': 'cd', + 'Cyber Laws and Ethics': 'cle', + 'Cryptography & Network Security': 'cns', + 'Machine Learning': 'ml', + 'Natural Language Processing': 'nlp', + 'Deep Learning': 'dl', + 'Computer Vision and Image Processing': 'cvip', + 'Blockchain Technology': 'bt', + 'Information Retrieval': 'ir', + 'Management Information Systems': 'mis', + 'VLSI and Embedded Systems': 'vlsi', + 'Entrepreneurship & Startup': 'es', + 'Financial Management': 'fm', + 'Robotic Access Automation': 'raa', + 'Marketing Management': 'mm', + 'Big-data Analytics': 'bda', + 'Decision Sciences': 'des', + 'Software Engineering': 'se', }; // Available subjects -const available = ["ep", "c", "em1", "em2", "oops", "dsc", "coa", "os", "ml", "dops", "cd", "cle", "ec", "dbms", "bme", "cns", "vlsi", "mb"]; +const available = ['ep', 'c', 'em1', 'em2', 'oops', 'dsc', 'coa', 'os', 'ml', 'dops', 'cd', 'cle', 'ec', 'dbms', 'bme', 'cns', 'vlsi', 'mb']; export default function SubjectsSection() { - return ( -
-

- Browse Subjects -

-

- Explore Subjects divided Semester-wise for your convenience. -

-
- {Object.entries(subjects).map(([semester, list]) => { - const semCode = semester.toLowerCase().replace("semester-", "sem"); - return ( -
-

{semester}

-
- {list.map((subj) => { - const code = subjectCodes[subj]; - const href = `/${semCode}/${code}/ch0`; - const isAvailable = available.includes(code); + return ( +
+

+ Browse Subjects +

+

+ Explore Subjects divided Semester-wise for your convenience. +

+
+ {Object.entries(subjects).map(([semester, list]) => { + const semCode = semester.toLowerCase().replace('semester-', 'sem'); + return ( +
+

{semester}

+
+ {list.map((subj) => { + const code = subjectCodes[subj]; + const href = `/${semCode}/${code}/ch0`; + const isAvailable = available.includes(code); - const baseClass = - "relative bg-[#d2b48c] text-[#2b1b0e] flex items-center justify-center font-medium py-4 px-6 shadow-md"; + const baseClass = 'relative bg-[#d2b48c] text-[#2b1b0e] flex items-center justify-center font-medium py-4 px-6 shadow-md'; - return isAvailable ? ( - - {subj} - - ) : ( -
- {subj} - - Coming Soon - -
- ); + return isAvailable ? ( + + {subj} + + ) : ( +
+ {subj} + Coming Soon +
+ ); + })} +
+
+ ); })} -
- ); - })} -
- -
- ); + + ); }