import React from 'react' import { useForm } from 'react-hook-form' import { Select, Card, Body, Button } from 'playbook-ui' const SelectForm = (props) => { const { register, handleSubmit, formState: { errors }, watch, } = useForm({ defaultValues: { favoriteFood: '', mealType: '', dietaryRestrictions: '', } }) const onSubmit = (data) => { console.log('Form submitted:', data) } // Watch form values for real-time display const formValues = watch() const foodOptions = [ { value: 'pizza', text: 'Pizza' }, { value: 'burger', text: 'Burger' }, { value: 'sushi', text: 'Sushi' }, { value: 'salad', text: 'Salad' }, ] const mealTypes = [ { value: 'breakfast', text: 'Breakfast' }, { value: 'lunch', text: 'Lunch' }, { value: 'dinner', text: 'Dinner' }, ] const dietaryOptions = [ { value: 'none', text: 'No Restrictions' }, { value: 'vegetarian', text: 'Vegetarian' }, { value: 'vegan', text: 'Vegan' }, { value: 'glutenFree', text: 'Gluten Free' }, ] return (
{JSON.stringify(formValues, null, 2)}