organizationStatus.tsx 883 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. import {Alert} from 'sentry/components/core/alert';
  2. import type {Subscription} from 'getsentry/types';
  3. type Props = {
  4. orgStatus: Subscription['orgStatus'];
  5. };
  6. function OrganizationStatus({orgStatus}: Props) {
  7. if (!orgStatus) {
  8. return null;
  9. }
  10. if (orgStatus.id === 'visible') {
  11. return null;
  12. }
  13. let message: string | undefined = undefined;
  14. switch (orgStatus.id) {
  15. case 'pending_deletion':
  16. message = 'This organization has been queued for deletion.';
  17. break;
  18. case 'deletion_in_progress':
  19. message = 'This organization in the process of being deleted.';
  20. break;
  21. default:
  22. break;
  23. }
  24. if (!message) {
  25. return null;
  26. }
  27. return (
  28. <Alert.Container>
  29. <Alert data-test-id="deletion-status" type="error" showIcon>
  30. {message}
  31. </Alert>
  32. </Alert.Container>
  33. );
  34. }
  35. export default OrganizationStatus;