import * as React from 'react';

import '../../styles/styles.scss';

function Badge({tag, tagObj, isSource, onRemove}) {
    return <div className={`badge ${isSource && 'badge--source'} ${tagObj && 'badge--filter'}`}>
        {tag || tagObj.label}
        {onRemove ? <span onClick={(() => onRemove(tag || tagObj))} /> : null}
    </div>;
}

export default Badge;
