import React from 'react'
import PropTypes from 'prop-types'
import CX from 'classnames'
import _ from 'lodash'
import './index.less'
function RadioButton(props) {
const {
style, title, isChecked, onClick,
} = props
const wrapperStyle = _.assign({}, style)
return (
<div
className="checkbox-wrap"
style={wrapperStyle}
onClick={onClick}
role="button"
tabIndex={0}
>
<span
className={CX({
checkbox: true,
checked: isChecked === true,
})}
/>
<span className="tip-text">{title}</span>
</div>
)
}
RadioButton.propTypes = {
style: PropTypes.object,
title: PropTypes.string,
isChecked: PropTypes.bool,
onClick: PropTypes.func,
}
RadioButton.defaultProps = {
style: {},
title: '',
isChecked: false,
onClick: _.noop,
}
export default RadioButton
import React from 'react'
import PropTypes from '