integrationStatus.tsx 894 B

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