import React from 'react';
import {Check, SIZE, COLOR} from '@propellerads/icon';

import {StyledSuccessLabel, StyledIcon, StyledMessage} from './style';
import {SuccessLabelProps} from './types';

const SuccessLabel = ({show = true, children, elementId = ''}: SuccessLabelProps) => (
  <StyledSuccessLabel show={show} id={elementId}>
    <StyledIcon>
      <Check
        color={COLOR.SUCCESS}
        size={SIZE.SMALL}
      />
    </StyledIcon>

    <StyledMessage>
      {children}
    </StyledMessage>
  </StyledSuccessLabel>
);

export default SuccessLabel;
