relatedIssuesNotAvailable.tsx 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. import styled from '@emotion/styled';
  2. import Feature from 'sentry/components/acl/feature';
  3. import {LinkButton} from 'sentry/components/button';
  4. import {Alert} from 'sentry/components/core/alert';
  5. import type {LinkProps} from 'sentry/components/links/link';
  6. import Panel from 'sentry/components/panels/panel';
  7. interface Props {
  8. buttonText: string;
  9. buttonTo: LinkProps['to'];
  10. }
  11. export const RELATED_ISSUES_BOOLEAN_QUERY_ERROR =
  12. 'Error parsing search query: Boolean statements containing "OR" or "AND" are not supported in this search';
  13. /**
  14. * Renders an Alert box of type "info" for boolean queries in alert details. Renders a discover link if the feature is available.
  15. */
  16. export function RelatedIssuesNotAvailable({buttonTo, buttonText}: Props) {
  17. return (
  18. <Alert.Container>
  19. <StyledAlert
  20. type="info"
  21. showIcon
  22. trailingItems={
  23. <Feature features="discover-basic">
  24. <LinkButton priority="default" size="xs" to={buttonTo}>
  25. {buttonText}
  26. </LinkButton>
  27. </Feature>
  28. }
  29. >
  30. <div data-test-id="loading-error-message">
  31. Related Issues unavailable for this alert.
  32. </div>
  33. </StyledAlert>
  34. </Alert.Container>
  35. );
  36. }
  37. const StyledAlert = styled(Alert)`
  38. ${Panel} & {
  39. border-radius: 0;
  40. border-width: 1px 0;
  41. }
  42. `;