You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Label.js 821B

12345678910111213141516171819202122232425262728
  1. import React from "react";
  2. import { LabelContainer, LeftLabel, RightLabel } from "./Label.styled";
  3. import PropTypes from "prop-types";
  4. export const Label = (props) => {
  5. return (
  6. <LabelContainer
  7. onClick={props.onClick}
  8. maxWidth={props.maxWidth}
  9. style={props.containerStyle}
  10. className={props.className}
  11. >
  12. <LeftLabel style={props.leftTextStyle}>{props.leftText}</LeftLabel>
  13. {props.rightText && <RightLabel>{props.rightText}</RightLabel>}
  14. </LabelContainer>
  15. );
  16. };
  17. Label.propTypes = {
  18. onClick: PropTypes.func,
  19. leftText: PropTypes.string,
  20. rightText: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
  21. maxWidth: PropTypes.string,
  22. leftTextStyle: PropTypes.any,
  23. rightTextStyle: PropTypes.any,
  24. containerStyle: PropTypes.any,
  25. className: PropTypes.any,
  26. };