feat(editor): Bild-Block skip wenn recipe.id === null

This commit is contained in:
hsiegeln
2026-04-21 10:44:48 +02:00
parent 06e60afc88
commit 8c23875ba2
2 changed files with 30 additions and 15 deletions

View File

@@ -134,14 +134,20 @@
</script>
<div class="editor">
<section class="block">
<h2>Bild</h2>
<ImageUploadBox
recipeId={recipe.id!}
imagePath={recipe.image_path}
onchange={(p) => onimagechange?.(p)}
/>
</section>
{#if recipe.id !== null}
<section class="block">
<h2>Bild</h2>
<ImageUploadBox
recipeId={recipe.id}
imagePath={recipe.image_path}
onchange={(p) => onimagechange?.(p)}
/>
</section>
{:else}
<section class="block info">
<p class="hint">Bild kannst du nach dem Speichern hinzufügen.</p>
</section>
{/if}
<div class="meta">
<label class="field">
@@ -271,6 +277,15 @@
margin: 0 0 0.75rem;
color: #2b6a3d;
}
.block.info {
background: #f6faf7;
border: 1px dashed #cfd9d1;
}
.hint {
color: #666;
margin: 0;
font-size: 0.9rem;
}
.ing-list {
list-style: none;
padding: 0;