checkInIcon.tsx 717 B

123456789101112131415161718192021222324252627282930
  1. import styled from '@emotion/styled';
  2. import {CheckInStatus} from '../types';
  3. type Props = {
  4. size: number | string;
  5. status: CheckInStatus;
  6. color?: string;
  7. };
  8. export default styled('div')<Props>`
  9. display: inline-block;
  10. position: relative;
  11. border-radius: 50%;
  12. height: ${p => p.size}px;
  13. width: ${p => p.size}px;
  14. ${p =>
  15. p.color
  16. ? `background: ${p.color};`
  17. : `background: ${
  18. p.status === CheckInStatus.ERROR || p.status === CheckInStatus.TIMEOUT
  19. ? p.theme.error
  20. : p.status === CheckInStatus.OK
  21. ? p.theme.success
  22. : p.status === CheckInStatus.MISSED
  23. ? p.theme.warning
  24. : p.theme.disabled
  25. };`};
  26. `;