import React, { ChangeEvent } from "react"; import { Help } from "../index"; import styled from "styled-components"; const StyledRadio = styled.label` margin-right: 0.5em; `; type Props = { label?: string; name?: string; value?: string; checked: boolean; onChange?: (value: boolean, name?: string) => void; disabled?: boolean; helpText?: string; }; class Radio extends React.Component { renderHelp = () => { const helpText = this.props.helpText; if (helpText) { return ; } }; onValueChange = (event: ChangeEvent) => { if (this.props.onChange) { this.props.onChange(event.target.checked, this.props.name); } }; render() { return ( <> {/* we have to ignore the next line, because jsx label does not the custom disabled attribute but bulma does. // @ts-ignore */} {" "} {this.props.label} {this.renderHelp()} ); } } export default Radio;