--- /* --------------------------------------------------------------------------- * MultiSelectAsyncField — checkbox grid for picking multiple options. * * Submits as repeated form values under field.key[] (browser default for * multiple checkboxes with the same name). The route handler in step 7 * normalises the array form via getAll(). * ------------------------------------------------------------------------- */ import type { MultiSelectAsyncField } from '../../resource-types'; interface Props { field: MultiSelectAsyncField; value: unknown; } const { field, value } = Astro.props; const options = await field.loadOptions(); const selected = new Set(); if (Array.isArray(value)) { for (const v of value) selected.add(String(v)); } ---
{field.label} {options.length === 0 && (

No options available.

)} {options.map(opt => { const id = `f-${field.key}-${opt.value}`; const isChecked = selected.has(String(opt.value)); return ( ); })}