import React from "react";
import PropTypes from "prop-types";
import cn from "classnames";
import { IControlledRadioButtonProps } from "./radio-button.d";
const RadioButton = (props: IControlledRadioButtonProps) => {
const {
className,
name,
value,
label,
onSelected,
inline,
checked,
disabled,
globalDisabled
} = props;
const testId = props["data-testid"] || "honeyui-radio";
return (
onSelected && onSelected(value)}
/>
);
};
RadioButton.displayName = "RadioButton";
RadioButton.defaultProps = {
className: "",
checked: false,
inline: false,
onSelected: () => {}
};
RadioButton.propTypes = {
className: PropTypes.string,
name: PropTypes.string,
value: PropTypes.oneOfType([PropTypes.number, PropTypes.string, PropTypes.bool]).isRequired,
checked: PropTypes.bool,
label: PropTypes.string.isRequired,
inline: PropTypes.bool,
onSelected: PropTypes.func,
disabled: PropTypes.bool
};
export default RadioButton;