index.js 467 B

1234567891011121314151617181920
  1. import React from 'react';
  2. import './index.less';
  3. import Button from '../Button';
  4. function RadioButton(props) {
  5. const { list, checked } = props;
  6. return (
  7. <div className="radio-button">
  8. {list.map(item => {
  9. return (
  10. <Button theme={item.key === checked ? 'theme' : 'default'} size="small" radius>
  11. {item.title}
  12. </Button>
  13. );
  14. })}
  15. </div>
  16. );
  17. }
  18. RadioButton.propTypes = {};
  19. export default RadioButton;