index.tsx 575 B

123456789101112131415161718192021222324252627282930313233
  1. import React, { forwardRef } from 'react';
  2. import { Wrapper } from './styled';
  3. type Props = {
  4. onBlur: () => void;
  5. onMouseDown: () => void;
  6. onMouseOver: () => void;
  7. onMouseOut: () => void;
  8. onKeyDown: (e: React.KeyboardEvent) => void;
  9. children: React.ReactNode;
  10. };
  11. type Ref = HTMLDivElement;
  12. const index = forwardRef<Ref, Props>(({
  13. children,
  14. ...rest
  15. }: Props, ref) => (
  16. <Wrapper
  17. ref={ref}
  18. tabIndex={0}
  19. role="button"
  20. onFocus={(): void => {
  21. // do nothing
  22. }}
  23. {...rest}
  24. >
  25. {children}
  26. </Wrapper>
  27. ));
  28. export default index;