"use client" import * as React from "react" import { cn } from "@/lib/utils" interface RadioGroupContextValue { value?: string onValueChange?: (value: string) => void name?: string } const RadioGroupContext = React.createContext({}) interface RadioGroupProps extends React.HTMLAttributes { value?: string onValueChange?: (value: string) => void name?: string } const RadioGroup = React.forwardRef( ({ className, value, onValueChange, name, ...props }, ref) => { return (
) } ) RadioGroup.displayName = "RadioGroup" interface RadioGroupItemProps extends React.InputHTMLAttributes { value: string } const RadioGroupItem = React.forwardRef( ({ className, value, ...props }, ref) => { const context = React.useContext(RadioGroupContext) return ( context.onValueChange?.(value)} {...props} /> ) } ) RadioGroupItem.displayName = "RadioGroupItem" export { RadioGroup, RadioGroupItem }