Clicking a recipe card navigates toDocumentation 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.
/recipe/:id, where the full recipe is displayed — image, category, ingredients, instructions, and an optional video tutorial.
Route and data fetching
TheRecipeDetail page reads the id parameter from the URL using React Router’s useParams, then passes it to the useRecipeDetail hook to load the recipe.
id changes, so navigating between recipe pages always loads fresh data.
Recipe object shape
ThegetRecipeById API call returns a recipe object with the following structure:
| Field | Type | Description |
|---|---|---|
id | string | Unique recipe identifier |
name | string | Recipe name |
picture | string | URL of the recipe image |
category | string | Meal category |
instructions | string | Full cooking instructions |
video | string | null | YouTube URL for the tutorial, or null if unavailable |
ingredients | array | List of ingredient objects |
ingredients has:
| Field | Type | Description |
|---|---|---|
name | string | Ingredient name |
measure | string | Quantity and unit (e.g. “2 tbsp”) |
RecipeDetailCard component
RecipeDetailCard renders all the recipe content. It also connects to the favorites system via the useFavorites hook.
RecipeDetailCard.jsx
UI sections
The detail page is laid out in the following order:Name and category
The recipe name appears as a
<h3> heading, followed by the category as a <p> element.Ingredients list
An unordered list renders each ingredient as
{ig.name} - {ig.measure} — for example, “Olive Oil - 2 tbsp”.Video player
A
ReactPlayer is rendered unconditionally using the recipe.video YouTube URL and src prop. The player is 100% wide and 400px tall with controls enabled.Favorites button
A button toggles the recipe in/out of favorites. When already saved it reads ”💔 Remove from Favs”; when not saved it reads “❤️ Add to Favs”. See Favorites for details.
Video playback
Recipe Hub uses ReactPlayer to embed YouTube video tutorials. It uses thesrc prop (not url) and renders with controls, fixed at 400px height: