import React from "react"
import { createForm } from "@corets/form"
import { useForm } from "@corets/use-form"
import { useFormBinder } from "@corets/use-form-binder"
const Example = () => {
const form = useForm(() => createForm({
input: "text",
checkbox: true,
radio: "second",
select: "second",
}))
const bind = useFormBinder(form)
return (
<form { ...bind.form() }>
<input type="text" { ...bind.input("input") } />
<input type="checkbox" { ...bind.checkbox("checkbox") } />
<input type="radio" { ...bind.radio("radio", "first") } />
<input type="radio" { ...bind.radio("radio", "second") } />
<select { ...bind.select("select") }>
<option value="first">Option 1</option>
<option value="second">Option 2</option>
<option value="third">Option 3</option>
</select>
<button { ...bind.submit() }>Submit</button>
</form>
)
}