feat: complete faculty directory changes

This commit is contained in:
Buvan
2026-07-23 08:21:21 +05:30
parent 2bf7985f90
commit 67145fa207
11 changed files with 1317 additions and 215 deletions

28
test-filter.js Normal file
View File

@@ -0,0 +1,28 @@
const FACULTY_DATA = [
{
id: '9',
name: 'Prof. R. Vijayakumar',
designation: 'Assistant Professor',
department: 'Mechanical Engineering',
office: 'MECH Block, Room 102',
specialization: 'CAD/CAM, Robotics',
email: 'vijayakumar@rit.edu',
}
];
const searchFaculty = "";
const selectedDept = "Mechanical Engineering";
const filteredFaculty = FACULTY_DATA.filter((f) => {
const searchLower = searchFaculty.toLowerCase();
const matchSearch =
f.name.toLowerCase().includes(searchLower) ||
f.department.toLowerCase().includes(searchLower) ||
f.designation.toLowerCase().includes(searchLower) ||
(f.specialization && f.specialization.toLowerCase().includes(searchLower));
const matchDept = selectedDept === 'All Departments' || f.department === selectedDept;
return matchSearch && matchDept;
});
console.log(filteredFaculty);