'use client';
import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime";
import React from 'react';
import './index.scss';
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__*/ _jsxDEV("div", {
        className: classes,
        children: /*#__PURE__*/ _jsxDEV("div", {
            className: `${baseClass}__content`,
            children: [
                /*#__PURE__*/ _jsxDEV("span", {
                    className: `${baseClass}__count`,
                    children: count
                }, void 0, false, {
                    fileName: "src/elements/ErrorPill/index.tsx",
                    lineNumber: 32,
                    columnNumber: 9
                }, this),
                withMessage && ` ${count > 1 ? i18n.t('general:errors') : i18n.t('general:error')}`
            ]
        }, void 0, true, {
            fileName: "src/elements/ErrorPill/index.tsx",
            lineNumber: 31,
            columnNumber: 7
        }, this)
    }, void 0, false, {
        fileName: "src/elements/ErrorPill/index.tsx",
        lineNumber: 30,
        columnNumber: 5
    }, this);
};

//# sourceMappingURL=index.js.map