import React from "react" import { useForm } from "react-hook-form" import { Checkbox, Card, Body, Button } from "playbook-ui" const CheckboxForm = () => { const { register, handleSubmit, formState: { errors }, watch, } = useForm({ defaultValues: { termsAccepted: false, newsletter: false, interests: [], preferences: { emailUpdates: false, smsUpdates: false, pushNotifications: false, }, }, }) const onSubmit = (data) => { console.log("Form submitted:", data) } const formValues = watch() return (
{ const selectedInterests = Object.values(value).filter(Boolean) return ( selectedInterests.length >= 1 || "Please select at least one interest" ) }, }} text='Technology' value='technology' />
) } export default CheckboxForm