index.tsx 571 B

123456789101112131415161718192021222324252627282930
  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>(({ children, ...rest }: Props, ref) => (
  13. <Wrapper
  14. ref={ref}
  15. tabIndex={0}
  16. role="button"
  17. onFocus={(): void => {
  18. // do nothing
  19. }}
  20. {...rest}
  21. >
  22. {children}
  23. </Wrapper>
  24. ));
  25. export default index;