dynamicAlertsFeedbackButton.tsx 990 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import styled from '@emotion/styled';
  2. import {Button} from 'sentry/components/button';
  3. import {IconMegaphone} from 'sentry/icons';
  4. import {t} from 'sentry/locale';
  5. import {useFeedbackForm} from 'sentry/utils/useFeedbackForm';
  6. export default function DynamicAlertsFeedbackButton({}) {
  7. const openForm = useFeedbackForm();
  8. if (!openForm) {
  9. return null;
  10. }
  11. return (
  12. <ButtonContainer>
  13. <Button
  14. onClick={() => {
  15. openForm({
  16. formTitle: 'Anomaly Detection Feedback',
  17. messagePlaceholder: t(
  18. 'How can we make alerts using anomaly detection more useful?'
  19. ),
  20. tags: {
  21. ['feedback.source']: 'dynamic_thresholding',
  22. ['feedback.owner']: 'ml-ai',
  23. },
  24. });
  25. }}
  26. size="xs"
  27. icon={<IconMegaphone />}
  28. >
  29. Give Feedback
  30. </Button>
  31. </ButtonContainer>
  32. );
  33. }
  34. const ButtonContainer = styled('div')`
  35. padding: 8px 0px;
  36. `;