circleIndicator.tsx 466 B

1234567891011121314151617181920212223
  1. import styled from '@emotion/styled';
  2. type Props = {
  3. color?: string;
  4. enabled?: boolean;
  5. size?: number;
  6. };
  7. const CircleIndicator = styled('div')<Props>`
  8. display: inline-block;
  9. position: relative;
  10. border-radius: 50%;
  11. height: ${p => p.size}px;
  12. width: ${p => p.size}px;
  13. background: ${p => p.color ?? (p.enabled ? p.theme.success : p.theme.error)};
  14. `;
  15. CircleIndicator.defaultProps = {
  16. enabled: true,
  17. size: 14,
  18. };
  19. export default CircleIndicator;