CustomParamButton.tsx 642 B

123456789101112131415161718192021222324252627282930313233
  1. import React from 'react';
  2. export enum CustomParamButtonType {
  3. plus = 'fa-plus',
  4. minus = 'fa-minus',
  5. }
  6. interface Props {
  7. onClick: (event: React.MouseEvent<HTMLButtonElement>) => void;
  8. className: string;
  9. type: CustomParamButtonType;
  10. btnText?: string;
  11. }
  12. const CustomParamButton: React.FC<Props> = ({
  13. onClick,
  14. className,
  15. type,
  16. btnText,
  17. }) => (
  18. <button
  19. type="button"
  20. className={`button ${className} is-outlined`}
  21. onClick={onClick}
  22. >
  23. {btnText && <span>{btnText}</span>}
  24. <span className="icon">
  25. <i className={`fas fa-lg ${type}`} />
  26. </span>
  27. </button>
  28. );
  29. export default CustomParamButton;