loadingTriangle.tsx 946 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. import styled from '@emotion/styled';
  2. import sentryLoader from 'sentry-images/sentry-loader.svg';
  3. import space from 'sentry/styles/space';
  4. type Props = {
  5. children?: React.ReactNode;
  6. };
  7. function LoadingTriangle({children}: Props) {
  8. return (
  9. <LoadingTriangleWrapper data-test-id="loading-indicator">
  10. <CircleBackground>
  11. <img src={sentryLoader} />
  12. </CircleBackground>
  13. {children && <div>{children}</div>}
  14. </LoadingTriangleWrapper>
  15. );
  16. }
  17. const LoadingTriangleWrapper = styled('div')`
  18. position: absolute;
  19. top: 50%;
  20. left: 50%;
  21. width: 500px;
  22. transform: translate(-50%, -50%);
  23. display: flex;
  24. flex-direction: column;
  25. align-items: center;
  26. gap: ${space(3)};
  27. `;
  28. const CircleBackground = styled('div')`
  29. height: 150px;
  30. width: 150px;
  31. display: flex;
  32. align-items: center;
  33. justify-content: center;
  34. background: ${p => p.theme.white};
  35. border-radius: 50%;
  36. `;
  37. export default LoadingTriangle;