diff --git a/components/Funders.jsx b/components/Funders.jsx index ba4499a..b8c5063 100644 --- a/components/Funders.jsx +++ b/components/Funders.jsx @@ -37,7 +37,27 @@ function Partners({ funders }) { return date.toLocaleDateString('en-GB', options); }; + const resetFilters = () => { + setFilteredFunders(funders); + setQuery(''); + }; + const renderFunders = () => { + if (filteredFunders.length === 0) { + return ( +
+
+ No Funders +
+ +
+ ); + } return filteredFunders?.map((funder) => { return ( diff --git a/components/Partners.jsx b/components/Partners.jsx index e1760d8..cf0abc9 100644 --- a/components/Partners.jsx +++ b/components/Partners.jsx @@ -17,8 +17,28 @@ function Partners({ partners }) { setFilteredPartners(newFilteredPartners); }; - const renderPartners = () => - filteredPartners.map((partner) => ( + const resetFilters = () => { + setFilteredPartners(partners); + setQuery(''); + }; + + const renderPartners = () => { + if (filteredPartners.length === 0) { + return ( +
+
+ No Partners +
+ +
+ ); + } + return filteredPartners.map((partner) => (
@@ -44,6 +64,7 @@ function Partners({ partners }) { )); + }; return (
diff --git a/components/Solutions.jsx b/components/Solutions.jsx index 58cdb8a..4cb0a65 100644 --- a/components/Solutions.jsx +++ b/components/Solutions.jsx @@ -18,8 +18,28 @@ function Solutions({ solutions }) { setFilteredSolutions(newFilteredSolutions); }; - const renderSolutions = () => - filteredSolutions.map((solution) => ( + const resetFilters = () => { + setFilteredSolutions(solutions); + setQuery(''); + }; + + const renderSolutions = () => { + if (filteredSolutions.length === 0) { + return ( +
+
+ No Solution +
+ +
+ ); + } + return filteredSolutions.map((solution) => (
@@ -46,6 +66,7 @@ function Solutions({ solutions }) { )); + }; return (