---
import type { CollectionEntry } from 'astro:content'
interface Props {
field: CollectionEntry<'forms'>['data']['form']['fields'][number]
}
const field = Astro.props.field
const fieldType = field.type as astroHTML.JSX.HTMLInputTypeAttribute
---
{
() => {
switch (field.type) {
case 'textarea':
return (
)
case 'select':
return (
)
case 'radio':
case 'checkbox':
return (
{field.options?.map((opt, _) => (
))}
)
default:
return (
)
}
}
}