relatedIssuesNotAvailable.tsx 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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';
  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 const RelatedIssuesNotAvailable = ({buttonTo, buttonText}: Props) => (
  17. <StyledAlert
  18. type="info"
  19. showIcon
  20. trailingItems={
  21. <Feature features={['discover-basic']}>
  22. <Button type="button" priority="default" size="xs" to={buttonTo}>
  23. {buttonText}
  24. </Button>
  25. </Feature>
  26. }
  27. >
  28. <div data-test-id="loading-error-message">
  29. Related Issues unavailable for this alert.
  30. </div>
  31. </StyledAlert>
  32. );
  33. const StyledAlert = styled(Alert)`
  34. ${Panel} & {
  35. border-radius: 0;
  36. border-width: 1px 0;
  37. }
  38. `;