{#if !block}
Select a block to edit.
{:else}

{blockLabels[block.type as BlockType]}

{#if block.type === 'text'} updateData({ content })} /> {:else if block.type === 'image_text'} updateData(image)} />
updateData({ content })} />
{:else if block.type === 'timeline'} {#each block.data.items || [] as item, i}
updateArray('items', i, { title: e.currentTarget.value })} />
{/each} {:else if block.type === 'hero'} {:else if block.type === 'button'}
updateData({ variant: v })} />
updateData({ alignment: v })} formatLabel={titleCase} />
updateData({ size: v })} formatLabel={(v) => String({ xs: 'Extra Small', sm: 'Small', md: 'Medium', lg: 'Large' }[String(v)] || v)} />
Color
updateData({ color: e.currentTarget.value })} /> updateData({ color: e.currentTarget.value })} />
{:else if block.type === 'spacer'}
{:else if block.type === 'testimonials'}
{#each block.data.items || [] as item, i}
updateArray('items', i, { title: e.currentTarget.value })} />
{/each}
{:else if block.type === 'upcoming_calendar'}

Category filters

Choose categories to show in this block. Leave all unchecked to show every published event.

{#if eventCategories?.length}
{#each eventCategories as category} {/each}
{:else}

No event categories exist yet. Create events in the Calendar admin page first.

{/if}
{:else if block.type === 'shop'} {:else if block.type === 'checkout'} {/if}
updateData({ _background: { ...(block.data._background || {}), type: v } })} />
{#if block.data._background?.type === 'color'}
{/if} {#if block.data._background?.type === 'image'}
updateData({ _background: { ...(block.data._background || {}), imageUrl: image.url, imageAlt: image.alt } })} /> updateData({ _background: { ...(block.data._background || {}), attachment: v } })} /> updateData({ _background: { ...(block.data._background || {}), overlay: true, overlayOpacity: v } })} formatLabel={(v) => `${v}%`} />
{/if}
updateData({ _foreground: { ...(block.data._foreground || {}), mode: v } })} /> {#if block.data._foreground?.mode === 'custom'}
Heading
updateData({ _foreground: { ...(block.data._foreground || {}), headingColor: e.currentTarget.value } })} /> updateData({ _foreground: { ...(block.data._foreground || {}), headingColor: e.currentTarget.value } })} />
Sub heading
updateData({ _foreground: { ...(block.data._foreground || {}), subheadingColor: e.currentTarget.value } })} /> updateData({ _foreground: { ...(block.data._foreground || {}), subheadingColor: e.currentTarget.value } })} />
Text
updateData({ _foreground: { ...(block.data._foreground || {}), textColor: e.currentTarget.value } })} /> updateData({ _foreground: { ...(block.data._foreground || {}), textColor: e.currentTarget.value } })} />
{/if}
{/if}