import { useMemo } from 'react' import { Link, routes } from '@redwoodjs/router' import { countEmotes } from 'src/helpers/emote' import ImageUploader from 'src/components/ImageUploader' const ProjectsList = ({ projects, shouldFilterProjectsWithoutImage = false, }) => { // temporary filtering projects that don't have images until some kind of search is added and there are more things on the website // it helps avoid the look of the website just being filled with dumby data. // related issue-104 const filteredProjects = useMemo( () => (shouldFilterProjectsWithoutImage ? projects.filter(({ mainImage }) => mainImage) : [...projects] ) // sort should probably be done on the service, but the filtering is temp too .sort( (a, b) => new Date(b.updatedAt).getTime() - new Date(a.updatedAt).getTime() ), [projects, shouldFilterProjectsWithoutImage] ) return (
) } export default ProjectsList