diff --git a/playground/app/components/recipe/StepContent.vue b/playground/app/components/recipe/StepContent.vue index 4c1b7ce0..73481102 100644 --- a/playground/app/components/recipe/StepContent.vue +++ b/playground/app/components/recipe/StepContent.vue @@ -40,6 +40,14 @@ function isGroupedItemSelected(item: IngredientItem): boolean { return isAlternativeSelected(props.recipe, props.choices ?? {}, item); } +/** + * Preparation lives on the referenced ingredient (distinct preparations + * yield distinct ingredient entries), so it is resolved per alternative. + */ +function getPreparation(alt: IngredientAlternative): string | undefined { + return props.recipe.ingredients[alt.index]?.preparation; +} + /** * Convert equivalents to a QuantityWithPlainUnit array. */ @@ -118,7 +126,15 @@ function getVisibleAlternatives( /> {{ " " }} - {{ item.alternatives[0]?.displayName }} + {{ item.alternatives[0]?.displayName + }} + ({{ getPreparation(item.alternatives[0]) }}) @@ -154,6 +170,12 @@ function getVisibleAlternatives( }" >{{ visibleAlt.alt.displayName }} + + ({{ getPreparation(visibleAlt.alt) }})