Skip to content

Commit

Permalink
style: fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Kushagra~ committed Jan 28, 2025
1 parent 5f10063 commit c331641
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 21 deletions.
25 changes: 12 additions & 13 deletions components/ScholarshipTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,19 +90,18 @@ const ScholarshipTable = ({
</a>
</TableCell>
<TableCell>
<TableCell>
<button
className={`px-2 py-1 rounded ${
expandedRows[index]
? "bg-red-500 text-white hover:bg-red-600"
: "bg-blue-500 text-white hover:bg-blue-600"
}`}
onClick={() => toggleRowExpansion(index)}
>
{expandedRows[index] ? "Show Less" : "Show More"}
</button>
</TableCell>

<TableCell>
<button
className={`px-2 py-1 rounded ${
expandedRows[index]
? "bg-red-500 text-white hover:bg-red-600"
: "bg-blue-500 text-white hover:bg-blue-600"
}`}
onClick={() => toggleRowExpansion(index)}
>
{expandedRows[index] ? "Show Less" : "Show More"}
</button>
</TableCell>
</TableCell>
</tr>
{expandedRows[index] && (
Expand Down
12 changes: 4 additions & 8 deletions pages/college_predictor.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,28 +41,25 @@ const CollegePredictor = () => {
// Search Function for fuse
const searchFun = (e) => {
const searchValue = e.target.value.trim();

// If the search box is empty, reset to full data
if (searchValue === "") {
setFilteredData(fullData); // Ensure `fullData` is not empty
setError(null); // Clear any previous error message
return;
}

const result = fuse.search(searchValue);

// Handle no matches found
if (result.length === 0) {
``// Empty the table
``; // Empty the table
setError("No matches found. Please try again."); // Show error
} else {
setFilteredData(result.map((r) => r.item)); // Update filtered data
setError(null); // Clear any error message
}
};




const fetchData = async (query) => {
setIsLoading(true);
Expand Down Expand Up @@ -224,7 +221,6 @@ const CollegePredictor = () => {
</div>
</>
);

};

export default CollegePredictor;

0 comments on commit c331641

Please sign in to comment.