import React from 'react';
const baseClass = 'error-pill';
export const ErrorPill = (props)=>{
    const { className, count, i18n, withMessage } = props;
    const lessThan3Chars = !withMessage && count < 99;
    const classes = [
        baseClass,
        lessThan3Chars && `${baseClass}--fixed-width`,
        className && className
    ].filter(Boolean).join(' ');
    if (count === 0) return null;
    return /*#__PURE__*/ React.createElement("div", {
        className: classes
    }, /*#__PURE__*/ React.createElement("div", {
        className: `${baseClass}__content`
    }, /*#__PURE__*/ React.createElement("span", {
        className: `${baseClass}__count`
    }, count), withMessage && ` ${count > 1 ? i18n.t('general:errors') : i18n.t('general:error')}`));
};

//# sourceMappingURL=index.js.map