diff --git a/frontend/src/components/SearchSite/SearchSite.tsx b/frontend/src/components/SearchSite/SearchSite.tsx index 227d99c..8de2de5 100644 --- a/frontend/src/components/SearchSite/SearchSite.tsx +++ b/frontend/src/components/SearchSite/SearchSite.tsx @@ -14,7 +14,7 @@ export default function SearchSite({ allRecipes }: { allRecipes: any[] }) { } } - let heading = "Unsere Empfehlungen" + const randomRecipes = allRecipes .sort(() => Math.random() - Math.random()) @@ -54,14 +54,15 @@ export default function SearchSite({ allRecipes }: { allRecipes: any[] }) { const [searchInput, setSearchInput] = useState(''); const [filteredRecipes, setFilteredRecipes] = useState(allRecipes); - + const [heading, setHeading] = useState("Unsere Empfehlungen"); + const [recipes, setRecipes] = useState("items"); const handleSearch = () => { const filteredRecipes = allRecipes.filter(recipe => - recipe.name.toLowerCase().includes(searchInput) + recipe.name.toLowerCase().includes(searchInput.toLocaleLowerCase()) ); - const items = filteredRecipes.map((recipe) => { + const filtered = filteredRecipes.map((recipe) => { const img = `data:image/jpeg;base64,${recipe.picture}`; return ( ): void => { @@ -126,7 +128,7 @@ export default function SearchSite({ allRecipes }: { allRecipes: any[] }) {