'use client' import { cx } from 'class-variance-authority' import { Label, Radio, RadioGroup, Text } from 'react-aria-components' import { Divider } from '../../Divider' import { Typography } from '../../Typography' import styles from './radioButtonsGroup.module.css' interface Option { value: string title: string text: string } interface RadioButtonsGroupProps { options: Option[] onChange: (value: string) => void ariaLabel: string defaultOption?: Option } export function RadioButtonsGroup({ options, onChange, ariaLabel, defaultOption, }: RadioButtonsGroupProps) { return ( {options.map((option) => ( cx(styles.option, { [styles.focused]: isFocusVisible, [styles.selected]: isSelected, [styles.hovered]: isHovered, [styles.disabled]: isDisabled, }) } > {({ isSelected, isDisabled }) => (
{option.text}
)}
))}
) }