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.tsx 913B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. import React from 'react';
  2. interface IProps {
  3. /**
  4. * The text for the Label.
  5. */
  6. children: React.ReactElement;
  7. /**
  8. * The CSS class of the label.
  9. */
  10. className?: string;
  11. /**
  12. * The (round) number prefix for the Label.
  13. */
  14. number?: string | number;
  15. /**
  16. * The click handler.
  17. */
  18. onClick?: (e?: React.MouseEvent) => void;
  19. }
  20. /**
  21. * Label for the dialogs.
  22. *
  23. * @returns {ReactElement}
  24. */
  25. function Label({ children, className, number, onClick }: IProps) {
  26. const containerClass = className
  27. ? `prejoin-dialog-label ${className}`
  28. : 'prejoin-dialog-label';
  29. return (
  30. <div
  31. className = { containerClass }
  32. onClick = { onClick }>
  33. {number && <div className = 'prejoin-dialog-label-num'>{number}</div>}
  34. <span>{children}</span>
  35. </div>
  36. );
  37. }
  38. export default Label;