{$state.value in stateMachine.states && stateMachine.states[$state.value].meta ? stateMachine.states[$state.value].meta.title : 'Unknown state'}

{$state.value in stateMachine.states ? stateMachine.states[$state.value].meta.description : ''}

{#if stateMachine.states[$state.value].meta.composite} {/if} {#if $state.value === 'start'}Welcome{:else if $state.value === 'name'}
{#if $errors.name} {$errors.name} {:else} {/if}
{:else if $state.value === 'email'}
{#if $errors.email} {$errors.email} {:else} {/if}
{:else if $state.value === 'summary'}

Name: {$form.name}

Email: {$form.email}

{:else if $state.value === 'submitting'} Add spinner here {:else if $state.value === 'success'}

Thank you for your submission!

{:else if $state.value === 'failure'}

Error: {$state.context.error?.message || 'An unknown error occurred.'}

{/if} {#if possibleActions}
{#each $possibleActions as action (action)} {#if action === 'BACK'} {/if} {/each} {#each $possibleActions as action (action)} {#if action !== 'NEXT' && action !== 'BACK'} {/if} {/each} {#each $possibleActions as action (action)} {#if action === 'NEXT'} {/if} {/each}
{/if}