Skip to content

Commit a4bf8d1

Browse files
committed
now the filter data are all from data folder not hardcoded
1 parent 88e915f commit a4bf8d1

2 files changed

Lines changed: 111 additions & 87 deletions

File tree

components/repeto/FilterSection.tsx

Lines changed: 2 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { useState } from 'react';
22
import { ChevronDown, ChevronUp, Filter, X } from 'lucide-react';
3+
import filtersData from '@/data/filters.json';
34

45
interface FilterOption {
56
title: string;
@@ -13,96 +14,10 @@ interface FilterSectionProps {
1314

1415
export default function FilterSection({ onFilterSubmit, onClearFilters }: FilterSectionProps) {
1516
const [isOpen, setIsOpen] = useState(false);
17+
const [filters] = useState<FilterOption[]>(filtersData);
1618
const [selectedOptions, setSelectedOptions] = useState<Record<string, Set<string>>>({});
1719
const [openDropdowns, setOpenDropdowns] = useState<Record<string, boolean>>({});
1820

19-
const filters: FilterOption[] = [
20-
{
21-
title: "Project Type",
22-
options: ["Final Year Project", "Mini Project", "Research Project", "Personal Project", "Others"]
23-
},
24-
{
25-
title: "Department",
26-
options: ["CSE", "IT", "EEE", "ECE", "MECH", "CIVIL", "Others"]
27-
},
28-
{
29-
title: "Year of Submission",
30-
options: ["2025", "2024", "2023", "2022", "2021"]
31-
},
32-
{
33-
title: "Domain",
34-
options: [
35-
"Other",
36-
"Web Development",
37-
"Mobile App Development (Android & iOS)",
38-
"Artificial Intelligence (AI) & Machine Learning (ML)",
39-
"Data Science & Big Data Analytics",
40-
"Cybersecurity & Ethical Hacking",
41-
"Blockchain & Cryptocurrency",
42-
"Cloud Computing & DevOps",
43-
"Game Development & AR/VR",
44-
"Internet of Things (IoT)",
45-
"Natural Language Processing (NLP)",
46-
"Database Management & Data Warehousing",
47-
"Quantum Computing",
48-
"Software Testing & Automation",
49-
"Full Stack Development (MERN, MEAN, etc.)",
50-
"UI/UX & Human-Computer Interaction",
51-
"Computer Networks & Network Security",
52-
"Augmented Reality (AR) & Virtual Reality (VR)",
53-
"E-commerce & CMS Development",
54-
"No-Code & Low-Code Development",
55-
"Cloud Security & Serverless Computing",
56-
"DevOps & Site Reliability Engineering (SRE)",
57-
"Edge Computing & Distributed Systems",
58-
"IT Infrastructure & System Administration",
59-
"Data Engineering & Business Intelligence",
60-
"IT Governance & Compliance",
61-
"Structural Engineering & Earthquake-Resistant Design",
62-
"Transportation & Highway Engineering",
63-
"Geotechnical Engineering & Soil Mechanics",
64-
"Smart Cities & Urban Planning",
65-
"Sustainable & Green Building Technology",
66-
"Hydraulics & Water Resource Engineering",
67-
"Construction Management & Project Planning",
68-
"Environmental Engineering & Waste Management",
69-
"Building Information Modeling (BIM)",
70-
"Disaster Management & Risk Analysis",
71-
"Bridge & Tunnel Engineering",
72-
"Surveying & Remote Sensing (GIS & GPS)",
73-
"VLSI & Chip Design",
74-
"Embedded Systems & Microcontrollers",
75-
"Wireless Communication (5G, LTE, Satellite)",
76-
"Signal & Image Processing",
77-
"Optical Fiber & Photonics",
78-
"Digital & Analog Circuit Design",
79-
"Antenna & RF Engineering",
80-
"Smart Sensors & Wearable Technology",
81-
"Audio & Speech Processing",
82-
"Biomedical Electronics & Bionics",
83-
"MEMS & Nanoelectronics",
84-
"Power Systems & Smart Grids",
85-
"Renewable Energy (Solar, Wind, Hydro)",
86-
"Control Systems & Automation",
87-
"Robotics & Mechatronics",
88-
"Electric Vehicles (EV) & Battery Technologies",
89-
"High Voltage Engineering",
90-
"Energy Management & Conservation",
91-
"Industrial Instrumentation & Process Control",
92-
"Electrical Machines & Drives",
93-
"Smart Home & Building Automation",
94-
"CAD, CAM & 3D Printing",
95-
"Automotive & Aerospace Engineering",
96-
"Thermodynamics & Fluid Mechanics",
97-
"Mechatronics & Smart Manufacturing",
98-
"HVAC & Refrigeration Systems",
99-
"Material Science & Composites",
100-
"Renewable Energy in Mechanical Systems",
101-
"Computational Fluid Dynamics (CFD)",
102-
"Finite Element Analysis (FEA)"
103-
]
104-
}
105-
];
10621

10722
const toggleDropdown = (filterTitle: string) => {
10823
setOpenDropdowns(prev => ({

data/filters.json

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
[
2+
{
3+
"title": "Project Type",
4+
"options": [
5+
"Final Year Project",
6+
"Mini Project",
7+
"Research Project",
8+
"Personal Project",
9+
"open source program",
10+
"Others"
11+
]
12+
},
13+
{
14+
"title": "Department",
15+
"options": [
16+
"CSE",
17+
"IT",
18+
"EEE",
19+
"ECE",
20+
"MECH",
21+
"CIVIL",
22+
"Others"
23+
]
24+
},
25+
{
26+
"title": "Year of Submission",
27+
"options": [
28+
"2025",
29+
"2024",
30+
"2023",
31+
"2022",
32+
"2021"
33+
]
34+
},
35+
{
36+
"title": "Domain",
37+
"options": [
38+
"Other",
39+
"Web Development",
40+
"Mobile App Development (Android & iOS)",
41+
"Artificial Intelligence (AI) & Machine Learning (ML)",
42+
"Data Science & Big Data Analytics",
43+
"Cybersecurity & Ethical Hacking",
44+
"Blockchain & Cryptocurrency",
45+
"Cloud Computing & DevOps",
46+
"Game Development & AR/VR",
47+
"Internet of Things (IoT)",
48+
"Natural Language Processing (NLP)",
49+
"Database Management & Data Warehousing",
50+
"Quantum Computing",
51+
"Software Testing & Automation",
52+
"Full Stack Development (MERN, MEAN, etc.)",
53+
"UI/UX & Human-Computer Interaction",
54+
"Computer Networks & Network Security",
55+
"Augmented Reality (AR) & Virtual Reality (VR)",
56+
"E-commerce & CMS Development",
57+
"No-Code & Low-Code Development",
58+
"Cloud Security & Serverless Computing",
59+
"DevOps & Site Reliability Engineering (SRE)",
60+
"Edge Computing & Distributed Systems",
61+
"IT Infrastructure & System Administration",
62+
"Data Engineering & Business Intelligence",
63+
"IT Governance & Compliance",
64+
"Structural Engineering & Earthquake-Resistant Design",
65+
"Transportation & Highway Engineering",
66+
"Geotechnical Engineering & Soil Mechanics",
67+
"Smart Cities & Urban Planning",
68+
"Sustainable & Green Building Technology",
69+
"Hydraulics & Water Resource Engineering",
70+
"Construction Management & Project Planning",
71+
"Environmental Engineering & Waste Management",
72+
"Building Information Modeling (BIM)",
73+
"Disaster Management & Risk Analysis",
74+
"Bridge & Tunnel Engineering",
75+
"Surveying & Remote Sensing (GIS & GPS)",
76+
"VLSI & Chip Design",
77+
"Embedded Systems & Microcontrollers",
78+
"Wireless Communication (5G, LTE, Satellite)",
79+
"Signal & Image Processing",
80+
"Optical Fiber & Photonics",
81+
"Digital & Analog Circuit Design",
82+
"Antenna & RF Engineering",
83+
"Smart Sensors & Wearable Technology",
84+
"Audio & Speech Processing",
85+
"Biomedical Electronics & Bionics",
86+
"MEMS & Nanoelectronics",
87+
"Power Systems & Smart Grids",
88+
"Renewable Energy (Solar, Wind, Hydro)",
89+
"Control Systems & Automation",
90+
"Robotics & Mechatronics",
91+
"Electric Vehicles (EV) & Battery Technologies",
92+
"High Voltage Engineering",
93+
"Energy Management & Conservation",
94+
"Industrial Instrumentation & Process Control",
95+
"Electrical Machines & Drives",
96+
"Smart Home & Building Automation",
97+
"CAD, CAM & 3D Printing",
98+
"Automotive & Aerospace Engineering",
99+
"Thermodynamics & Fluid Mechanics",
100+
"Mechatronics & Smart Manufacturing",
101+
"HVAC & Refrigeration Systems",
102+
"Material Science & Composites",
103+
"Renewable Energy in Mechanical Systems",
104+
"Computational Fluid Dynamics (CFD)",
105+
"Finite Element Analysis (FEA)"
106+
]
107+
}
108+
]
109+

0 commit comments

Comments
 (0)