index.tsx 608 B

1234567891011121314151617181920212223242526272829303132
  1. import * as React from 'react';
  2. import { StyledButton, StyledLabel } from './styles';
  3. interface Props {
  4. background?: string;
  5. foreground?: string;
  6. type?: 'contained' | 'outlined';
  7. children?: any;
  8. onClick?: (e: React.MouseEvent<HTMLDivElement>) => void;
  9. style?: any;
  10. }
  11. export const Button = ({
  12. background,
  13. foreground,
  14. type,
  15. onClick,
  16. children,
  17. style,
  18. }: Props) => (
  19. <StyledButton
  20. className="button"
  21. background={background}
  22. foreground={foreground}
  23. type={type}
  24. onClick={onClick}
  25. style={style}
  26. >
  27. <StyledLabel>{children}</StyledLabel>
  28. </StyledButton>
  29. );