import { useFormContext } from "react-hook-form" import { AncillaryCard } from "@/components/TempDesignSystem/AncillaryCard" import styles from "./ancillaryChoiceCard.module.css" import type { BreakfastChoiceCardProps } from "@/types/components/ancillaryCard" export default function BreakfastChoiceCard({ name, id, value, ancillary, }: BreakfastChoiceCardProps) { const { register, setValue } = useFormContext() function onLabelClick(event: React.MouseEvent) { // Preventing click event on label elements firing twice: https://github.com/facebook/react/issues/14295 event.preventDefault() setValue(name, value) } return ( ) }