All components live inDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Miguelcds/Recipe-Hub/llms.txt
Use this file to discover all available pages before exploring further.
src/components/. They are presentational by default — they receive props and render UI. The only exception is RecipeDetailCard, which reads from FavoritesContext directly.
NavBar
Site-wide navigation links rendered in the app header.
Footer
Static copyright footer rendered on every page.
SearchBar
Controlled search input with button click handler and validation.
RecipeCard
Linked thumbnail card for a single recipe in a list.
RecipeList
Grid container that maps an array of recipes to RecipeCard elements.
RecipeDetailCard
Full recipe view with ingredients, instructions, video, and favorite toggle.
NavBar
Renders the primary navigation usingNavLink from React Router. Active links receive the active class automatically.
Props: none
src/components/NavBar.jsx
NavBar is a named export (export const NavBar). Import it as import { NavBar } from '../components/NavBar'. The active class is applied manually via the className callback on the Favorites link.Footer
Static footer with copyright text. Powered by TheMealDB attribution. Props: nonesrc/components/Footer.jsx
SearchBar
Controlled search input. The parent (Home) owns the search state string and passes it down alongside a click handler. Empty-string validation happens in Home.handleClick before calling fetchRecipes.
Props
| Prop | Type | Description |
|---|---|---|
search | string | Controlled input value, owned by the parent |
setSearch | (value: string) => void | Updates the search string in parent state on every keystroke |
onSearch | () => void | Called when the Buscar button is clicked |
error | string | Validation error message to display below the input |
src/components/SearchBar.jsx
SearchBar is a named export (export const SearchBar). Import it as import { SearchBar } from '../components/SearchBar'. The component renders any non-empty error string below the input field.RecipeCard
Rendered byRecipeList for each item in a recipe array. Wraps the entire card in a Link to the recipe detail page.
Props
| Prop | Type | Description |
|---|---|---|
id | string | Meal ID from TheMealDB; used to build the /recipe/:id link |
name | string | Recipe name shown below the image |
picture | string | Thumbnail image URL |
category | string | Meal category label |
src/components/RecipeCard.jsx
RecipeList
Receives an array of recipe objects and renders a grid ofRecipeCard elements. Returns null when the array is empty, so the page renders nothing (rather than an empty container) before a search is performed.
Props
| Prop | Type | Description |
|---|---|---|
recipes | Array<{ id, name, picture, category }> | Array of normalized recipe objects from the API service |
src/components/RecipeList.jsx
RecipeDetailCard
Displays the full detail view of a recipe. This is the only component that reads from context directly — it callsuseFavorites to get toggleFavorite and isFavorite, enabling the favorite button without prop drilling.
Props
| Prop | Type | Description |
|---|---|---|
recipe | object | Full recipe object (see shape below) |
recipe object shape:
| Field | Type | Description |
|---|---|---|
id | string | Meal ID |
name | string | Recipe name |
picture | string | Image URL |
category | string | Meal category |
instructions | string | Full cooking instructions |
video | string | null | YouTube URL, or null if unavailable |
ingredients | Array<{ name: string, measure: string }> | List of ingredients with measures |
src/components/RecipeDetailCard.jsx
The
ReactPlayer is always rendered (not conditionally). It receives src (not url) and renders an embedded player. The video value from TheMealDB is the YouTube URL stored in recipe.video.