import React from 'react'; import { View, Text, TouchableOpacity } from 'react-native'; import { Picker } from '@react-native-picker/picker'; import { useForm, Controller } from 'react-hook-form'; import { z } from 'zod'; import { zodResolver } from '@hookform/resolvers/zod'; const appearanceFormSchema = z.object({ theme: z.enum(['light', 'dark'], { required_error: 'Please select a theme.', }), font: z.enum(['inter', 'manrope', 'system'], { invalid_type_error: 'Select a font', required_error: 'Please select a font.', }), }); type AppearanceFormValues = z.infer; const defaultValues: Partial = { theme: 'light', }; export function AppearanceForm() { const { control, handleSubmit } = useForm({ resolver: zodResolver(appearanceFormSchema), defaultValues, }); const onSubmit = (data: AppearanceFormValues) => { console.log(JSON.stringify(data, null, 2)); }; return ( Font ( )} /> Set the font you want to use in the dashboard. Theme Select the theme for the dashboard. ( onChange('light')} > Light onChange('dark')} > Dark )} /> Update preferences ); }