{#if $errors[fields[$state.context.currentField].name]}
{$errors[fields[$state.context.currentField].name]}
{:else}
{fields[$state.context.currentField].name.charAt(0).toUpperCase() + fields[$state.context.currentField].name.slice(1)}
{/if} {#if fields[$state.context.currentField].type === 'text'}
{:else if fields[$state.context.currentField].type === 'email'}
{:else if fields[$state.context.currentField].type === 'textarea'}
{:else if fields[$state.context.currentField].type === 'select'}
{:else if fields[$state.context.currentField].type === 'slider'}
{:else if fields[$state.context.currentField].type === 'toggle'}
{:else if fields[$state.context.currentField].type === 'number'}
{/if}
{#if $state.matches('submitting')}
Summary
{#each Object.entries($state.context.formData) as [key, value]}
{key}: {value}
{/each}
{/if}
send('PREV')} class="px-4 py-2 text-white bg-blue-500 rounded-md hover:bg-blue-600 focus:outline-none focus:ring-2 focus:ring-blue-500" disabled={$state.context.currentField === 0} > Previous
{#if !$state.matches('submitting')}
send('NEXT')} class="px-4 py-2 text-white bg-blue-500 rounded-md hover:bg-blue-600 focus:outline-none focus:ring-2 focus:ring-blue-500" disabled={$errors[fields[$state.context.currentField].name]} > Next
{/if} {#if $state.matches('submitting')}
Submit
{/if}