'use client' import { zodResolver } from '@hookform/resolvers/zod' import { useForm } from 'react-hook-form' import * as z from 'zod' import { Button, Checkbox, Form, toast } from '../' export const formSchema = z.object({ username: z.string().min(2, { message: 'Username must be at least 2 characters.', }), }) export const FormSchemaCheckbox = z.object({ mobile: z.boolean().default(false).optional(), }) export const FormSchemaDatePicker = z.object({ dob: z.date({ required_error: 'A date of birth is required.', }), }) export function CheckboxReactHookFormSingle() { const form = useForm>({ resolver: zodResolver(FormSchemaCheckbox), defaultValues: { mobile: true, }, }) function onSubmit(data: z.infer) { toast({ title: 'You submitted the following values:', description: (
                    
                        {JSON.stringify(data, null, 2)}
                    
                
), }) } return (
(
Use different settings for my mobile devices You can manage your mobile notifications in the mobile settings{' '} page.
)} />
) }