From 8df09b1134adb77074fb59004c4e93ce61dfcafe Mon Sep 17 00:00:00 2001 From: Hendrik Date: Fri, 17 Apr 2026 15:28:22 +0200 Subject: [PATCH] feat(ui): add unified RecipeView component with tabs and portion scaling Co-Authored-By: Claude Opus 4.7 (1M context) --- src/lib/components/RecipeView.svelte | 314 +++++++++++++++++++++++++++ 1 file changed, 314 insertions(+) create mode 100644 src/lib/components/RecipeView.svelte diff --git a/src/lib/components/RecipeView.svelte b/src/lib/components/RecipeView.svelte new file mode 100644 index 0000000..c93c9d0 --- /dev/null +++ b/src/lib/components/RecipeView.svelte @@ -0,0 +1,314 @@ + + +{#if banner} + {@render banner()} +{/if} + +
+
+ {#if recipe.image_path} + + {/if} +
+

{recipe.title}

+ {#if recipe.description} +

{recipe.description}

+ {/if} +
+ {#if recipe.category}{recipe.category}{/if} + {#if recipe.cuisine}{recipe.cuisine}{/if} + {#if recipe.tags} + {#each recipe.tags.slice(0, 6) as t (t)} + #{t} + {/each} + {/if} +
+ {#if timeSummary()} +

{timeSummary()}

+ {/if} + {#if recipe.source_url} +

+ Quelle: {recipe.source_domain} +

+ {/if} +
+
+ + {#if showActions} +
+ {@render showActions()} +
+ {/if} + +
+ + +
+ + {#if tab === 'ing'} +
+
+ +
+ {servings} + {recipe.servings_unit ?? 'Portionen'} +
+ +
+
    + {#each scaled as ing, i (i)} +
  • + {#if ing.quantity !== null || ing.unit} + + {formatQty(ing.quantity)} + {#if ing.unit} + {' '}{ing.unit} + {/if} + + {/if} + + {ing.name} + {#if ing.note} ({ing.note}){/if} + +
  • + {/each} +
+
+ {:else} +
+
    + {#each recipe.steps as step (step.position)} +
  1. {step.text}
  2. + {/each} +
+
+ {/if} +
+ +