quickContextWrapper.tsx 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import {ComponentProps} from 'react';
  2. import styled from '@emotion/styled';
  3. import LoadingIndicator from 'sentry/components/loadingIndicator';
  4. import {t} from 'sentry/locale';
  5. import {space} from 'sentry/styles/space';
  6. import {QuickContextHovercard} from 'sentry/views/discover/table/quickContext/quickContextHovercard';
  7. import {NoContextWrapper} from './styles';
  8. type NoContextProps = {
  9. isLoading: boolean;
  10. };
  11. export function NoContext({isLoading}: NoContextProps) {
  12. return isLoading ? (
  13. <NoContextWrapper>
  14. <LoadingIndicator
  15. data-test-id="quick-context-loading-indicator"
  16. hideMessage
  17. size={32}
  18. />
  19. </NoContextWrapper>
  20. ) : (
  21. <NoContextWrapper>{t('Failed to load context for column.')}</NoContextWrapper>
  22. );
  23. }
  24. export const HoverWrapper = styled('div')`
  25. display: flex;
  26. align-items: center;
  27. gap: ${space(0.75)};
  28. `;
  29. export function QuickContextHoverWrapper(
  30. props: ComponentProps<typeof QuickContextHovercard>
  31. ) {
  32. return (
  33. <HoverWrapper>
  34. <QuickContextHovercard {...props} />
  35. </HoverWrapper>
  36. );
  37. }