import React from 'react';
import type {  RadioChangeEvent } from 'antd';
import { Radio } from 'antd';

const style: React.CSSProperties = {
  display: 'flex',
  flexDirection: 'column',
  gap: 8,
};

type AppRadioProps = {
  checked: boolean;
  options?: [];
  children?: string;
  value?: string[] | boolean;
  onChange?: (value: RadioChangeEvent) => void;
  disabled?: boolean;
  isGroup?: boolean;
  className?: string;
}
const AppRadio: React.FC<AppRadioProps> = ({
  options = [],
  value,
  onChange,
  isGroup,
}) => {

  if (isGroup) {
    return (
      <Radio.Group
        style={style}
        onChange={onChange}
        value={value}
        options={options}
      />
    );
  }

  return (
    <Radio
      style={style}
      onChange={onChange}
      value={value}
    />
  );
};

export default AppRadio;