refactor(planner): extract shared recipe info markup into DayMealCard snippet
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -48,6 +48,15 @@
|
|||||||
);
|
);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
{#snippet recipeInfo()}
|
||||||
|
<h3 class="font-[var(--font-display)] text-[20px] font-[300] leading-tight text-[var(--color-text)]">
|
||||||
|
{slot.recipe?.name ?? ''}
|
||||||
|
</h3>
|
||||||
|
{#if metadata}
|
||||||
|
<p class="mt-1 font-[var(--font-sans)] text-[13px] text-[var(--color-text-muted)]">{metadata}</p>
|
||||||
|
{/if}
|
||||||
|
{/snippet}
|
||||||
|
|
||||||
{#if actionSheetMode}
|
{#if actionSheetMode}
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
@@ -57,12 +66,7 @@
|
|||||||
onclick={onactionsheet}
|
onclick={onactionsheet}
|
||||||
class="w-full text-left rounded-[var(--radius-lg)] border-2 p-4 transition-colors {borderClass}"
|
class="w-full text-left rounded-[var(--radius-lg)] border-2 p-4 transition-colors {borderClass}"
|
||||||
>
|
>
|
||||||
<h3 class="font-[var(--font-display)] text-[20px] font-[300] leading-tight text-[var(--color-text)]">
|
{@render recipeInfo()}
|
||||||
{slot.recipe!.name}
|
|
||||||
</h3>
|
|
||||||
{#if metadata}
|
|
||||||
<p class="mt-1 font-[var(--font-sans)] text-[13px] text-[var(--color-text-muted)]">{metadata}</p>
|
|
||||||
{/if}
|
|
||||||
</button>
|
</button>
|
||||||
{:else}
|
{:else}
|
||||||
<div
|
<div
|
||||||
@@ -72,12 +76,7 @@
|
|||||||
class="rounded-[var(--radius-lg)] border-2 p-4 transition-colors {borderClass}"
|
class="rounded-[var(--radius-lg)] border-2 p-4 transition-colors {borderClass}"
|
||||||
>
|
>
|
||||||
{#if slot.recipe}
|
{#if slot.recipe}
|
||||||
<h3 class="font-[var(--font-display)] text-[20px] font-[300] leading-tight text-[var(--color-text)]">
|
{@render recipeInfo()}
|
||||||
{slot.recipe.name}
|
|
||||||
</h3>
|
|
||||||
{#if metadata}
|
|
||||||
<p class="mt-1 font-[var(--font-sans)] text-[13px] text-[var(--color-text-muted)]">{metadata}</p>
|
|
||||||
{/if}
|
|
||||||
|
|
||||||
{#if !readonly}
|
{#if !readonly}
|
||||||
<div class="mt-3 flex gap-2">
|
<div class="mt-3 flex gap-2">
|
||||||
|
|||||||
Reference in New Issue
Block a user