/* CHALLENGE: Recipe Finder & Planner Objective: Build a recipe search interface that…
- User
/* CHALLENGE: Recipe Finder & Planner
Objective: Build a recipe search interface that queries the free MealDB API to search for recipes, display ingredients and instructions, and allow saving favorite meals to localStorage.
Requirements:
- State Management:
- Track the user's search query in an input field.
- Keep track of the active search term (the query actually submitted).
- Store the fetched meals array, loading state, and error message.
- Store a list of favorite recipes that persists across page refreshes.
- Store the currently selected meal object to display details in a Modal.
- Data Fetching & Side Effects (useEffect):
- Fetch data whenever the active search term changes.
- API Endpoint: https://www.themealdb.com/api/json/v1/1/search.php?s={searchTerm}
- Handle loading status during the fetch.
- Handle empty search results (API returns null when nothing matches).
- Persist the favorite list to localStorage using a second useEffect.
- Interactive UI & Components:
- Submit search on button click or pressing 'Enter'.
- Display quick-select tags (e.g. Pasta, Chicken, Dessert) to search instantly.
- Show the favorite list with thumbnails. Users can click to search/view, or remove them.
- Render recipe cards displaying image, name, category, and area.
- Add/remove recipes from favorites by toggling a heart icon/button.
- Open a detailed Modal on click to show instructions and ingredient lists.
- Parse ingredients dynamically: The API returns flat properties strIngredient1-20 and strMeasure1-20. Extract them into a clean array, filtering out empty items.
- Style with Tailwind CSS to make the interface look modern, clean, and interactive. */ use attractive color combination, text, box etc which is attractive ui are needed and i used javascript not typescript okie
- State Management:
Assistant
I'll build a Recipe Finder & Planner application for you. Let me first check the existing project structure.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.