quickContextWrapper.tsx 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import type {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. mini
  18. style={{width: '24px'}}
  19. />
  20. </NoContextWrapper>
  21. ) : (
  22. <NoContextWrapper>{t('Failed to load context for column.')}</NoContextWrapper>
  23. );
  24. }
  25. export const HoverWrapper = styled('div')`
  26. display: flex;
  27. align-items: center;
  28. gap: ${space(0.75)};
  29. `;
  30. export function QuickContextHoverWrapper(
  31. props: ComponentProps<typeof QuickContextHovercard>
  32. ) {
  33. return (
  34. <HoverWrapper>
  35. <QuickContextHovercard {...props} />
  36. </HoverWrapper>
  37. );
  38. }