relatedIssuesNotAvailable.tsx 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. import styled from '@emotion/styled';
  2. import Feature from 'sentry/components/acl/feature';
  3. import {Alert} from 'sentry/components/alert';
  4. import {Button} from 'sentry/components/button';
  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. <StyledAlert
  19. type="info"
  20. showIcon
  21. trailingItems={
  22. <Feature features="discover-basic">
  23. <Button priority="default" size="xs" to={buttonTo}>
  24. {buttonText}
  25. </Button>
  26. </Feature>
  27. }
  28. >
  29. <div data-test-id="loading-error-message">
  30. Related Issues unavailable for this alert.
  31. </div>
  32. </StyledAlert>
  33. );
  34. }
  35. const StyledAlert = styled(Alert)`
  36. ${Panel} & {
  37. border-radius: 0;
  38. border-width: 1px 0;
  39. }
  40. `;