Bin
2025-12-16 9e0b2ba2c317b1a86212f24cbae3195ad1f3dbfa
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import React from "react";
import { PropTypes } from "prop-types";
import { Radio } from "antd";
 
import Hint from "../Hint/Hint";
 
/**
 * Choice Component
 */
export default class ChoiceComponent extends React.Component {
  render() {
    let hint;
 
    if (this.props.hint) {
      hint = <Hint>[{this.props.hint}]</Hint>;
    }
 
    return (
      <Radio
        value={this.props.value}
        onChange={this.props.onChange}
        checked={this.props.checked}
        defaultChecked={this.props.checked}
      >
        {this.props.children}
        {hint}
      </Radio>
    );
  }
}
 
ChoiceComponent.propTypes = {
  children: PropTypes.oneOfType([PropTypes.string, PropTypes.element]).isRequired,
  value: PropTypes.string.isRequired,
  checked: PropTypes.bool,
  defaultChecked: PropTypes.bool,
  hint: PropTypes.string,
  onChange: PropTypes.func,
};