import type { ComponentProps } from 'react';
import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';

import './radio.css';

type RadioGroupItemProps = ComponentProps<typeof RadioGroupPrimitive.Item>;

function RadioGroupItem(props: RadioGroupItemProps) {
  return (
    <RadioGroupPrimitive.Item {...props} className="c-radio-item">
      <RadioGroupPrimitive.Indicator className="c-radio-indicator" />
    </RadioGroupPrimitive.Item>
  );
}

export const Radio = {
  Group: RadioGroupPrimitive.Root,
  Item: RadioGroupItem,
};
