integrationStatus.tsx 873 B

1234567891011121314151617181920212223242526272829303132333435
  1. import {useTheme} from '@emotion/react';
  2. import styled from '@emotion/styled';
  3. import CircleIndicator from 'sentry/components/circleIndicator';
  4. import {space} from 'sentry/styles/space';
  5. import type {IntegrationInstallationStatus} from 'sentry/types/integrations';
  6. import {COLORS} from './constants';
  7. type StatusProps = {
  8. status: IntegrationInstallationStatus;
  9. };
  10. const StatusWrapper = styled('div')`
  11. display: flex;
  12. align-items: center;
  13. `;
  14. const IntegrationStatus = styled(({status, ...p}: StatusProps) => {
  15. const theme = useTheme();
  16. return (
  17. <StatusWrapper>
  18. <CircleIndicator size={6} color={theme[COLORS[status]]} />
  19. <div {...p}>{status}</div>
  20. </StatusWrapper>
  21. );
  22. })`
  23. color: ${p => p.theme[COLORS[p.status]]};
  24. margin-left: ${space(0.5)};
  25. font-weight: light;
  26. margin-right: ${space(0.75)};
  27. `;
  28. export default IntegrationStatus;