import { zodResolver } from '@hookform/resolvers/zod' import { useForm } from 'react-hook-form' import { Button, Form, FormControl, FormField, Select_Shadcn_, SelectContent_Shadcn_, SelectItem_Shadcn_, SelectTrigger_Shadcn_, SelectValue_Shadcn_, } from 'ui' import { FormItemLayout } from 'ui-patterns/form/FormItemLayout/FormItemLayout' import { z } from 'zod' const FormSchema = z.object({ email: z .string({ required_error: 'Please select an email to display.', }) .email(), }) export default function FormItemLayoutDemo() { // 1. Define your form. const form = useForm>({ resolver: zodResolver(FormSchema), }) // 2. Define a submit handler. function onSubmit(values: z.infer) { // Do something with the form values. // ✅ This will be type-safe and validated. console.log(values) // action('form form.handleSubmit(onSubmit)')(values) } return (
( m@example.com m@google.com m@support.com )} /> ) }