Files
BajaUofCWebsite/src/Images/ImageFinder.js
2024-02-10 14:16:38 -07:00

11 lines
352 B
JavaScript

import imagesData from './Images.json';
// Function to search and filter images based on the provided category
export const ImageFinder = (category) => {
if (category === 'all') {
return imagesData;
} else {
const filteredImages = imagesData.filter(image => image.category === category);
return filteredImages;
}
};