import React from "react"; import classNames from "@calcom/lib/classNames"; type RadioAreaProps = React.InputHTMLAttributes; const RadioArea = React.forwardRef( ({ children, className, ...props }, ref) => { return ( ); } ); interface RadioAreaGroupProps extends Omit, "onChange"> { onChange?: (value: string) => void; } const RadioAreaGroup = ({ children, className, onChange, ...passThroughProps }: RadioAreaGroupProps) => { const childrenWithProps = React.Children.map(children, (child) => { if (onChange && React.isValidElement(child)) { return React.cloneElement(child, { onChange: (e: React.ChangeEvent) => { onChange(e.target.value); }, }); } return child; }); return (
{childrenWithProps}
); }; RadioAreaGroup.displayName = "RadioAreaGroup"; RadioArea.displayName = "RadioArea"; const Item = RadioArea; const Group = RadioAreaGroup; export { RadioArea, RadioAreaGroup, Item, Group };