import React from 'react';

import {StyledBadgeContainer, StyledBadgeIcon} from './style';
import {BADGE_TYPE, BadgeProps, CustomStyle} from './types';

const Badge = ({
  label = '',
  type = BADGE_TYPE.INFO,
  customStyle = {},
  icon = undefined,
}: BadgeProps) => (
  <StyledBadgeContainer type={type} customStyle={customStyle}>
    {icon && (
    <StyledBadgeIcon>
      {icon}
    </StyledBadgeIcon>
    )}
    {label}
  </StyledBadgeContainer>
);

export default Badge;
export {BADGE_TYPE, CustomStyle};
