button_groups.js 678 B

12345678910111213141516171819202122
  1. import { View, Row } from 'app/design/view'
  2. import { appSetting } from 'app/lib/util'
  3. import { Fragment } from 'react';
  4. const BtnClsSize = appSetting('theme', 'button_sizes');
  5. const BtnCls = appSetting('theme', 'button_styles');
  6. export function ButtonsGroup({
  7. size = 'base',
  8. children
  9. }) {
  10. return (
  11. <Row className={`${BtnCls.group?.container} ${BtnClsSize[size]?.rounded}`}>
  12. {children?.map((child, i) => (
  13. <Fragment key={`btngr-${i}`}>
  14. {child}
  15. {i < children.length - 1 && <View className={`${BtnCls.group?.separator}`} />}
  16. </Fragment>
  17. ))}
  18. </Row>
  19. )
  20. }