{#if components}
{#each Object.entries(components) as [key, component] (key)} {@const label = component.title || component.label || key}
{#if component.type === 'select'} {#if isPickerField(component.subType)} updateConfig(key, value)} /> {:else} {@const options = component.options?.map((opt) => { return { label: opt.label, value: String(opt.value) }; }) || [{ label: 'N/A', value: '' }]} {@const currentValue = actualConfig[key]} {@const selectedItem = options.find((opt) => opt.value === String(currentValue)) ?? options[0]} updateConfig(key, e.currentTarget.value)} required={component.required} /> {/if}
{/each}
{:else} No configuration required {/if}