import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
import { AccessCodeKeyIcon } from '../../../../lib/icons/AccessCodeKey.js';
import { ExclamationCircleOutlineIcon } from '../../../../lib/icons/ExclamationCircleOutline.js';
import { TriangleWarningOutlineIcon } from '../../../../lib/icons/TriangleWarningOutline.js';
export function AccessCodeMainIcon({ accessCode, }) {
    const errorCount = accessCode.errors.length;
    const warningCount = accessCode.warnings.length;
    const isPlural = errorCount === 0 || errorCount > 1;
    const errorIconTitle = isPlural
        ? `${errorCount} ${t.codeIssues}`
        : `${errorCount} ${t.codeIssue}`;
    const warningIconTitle = isPlural
        ? `${warningCount} ${t.codeIssues}`
        : `${warningCount} ${t.codeIssue}`;
    if (errorCount > 0) {
        return (_jsxs(_Fragment, { children: [_jsx("div", { className: 'seam-issue-icon-wrap seam-md-invisible', title: errorIconTitle, children: _jsx(ExclamationCircleOutlineIcon, {}) }), _jsx("div", { className: 'seam-invisible seam-md-flex', children: _jsx(AccessCodeKeyIcon, {}) })] }));
    }
    if (errorCount === 0 && warningCount > 0) {
        return (_jsxs(_Fragment, { children: [_jsx("div", { className: 'seam-issue-icon-wrap seam-md-invisible', title: warningIconTitle, children: _jsx(TriangleWarningOutlineIcon, {}) }), _jsx("div", { className: 'seam-invisible seam-md-flex', children: _jsx(AccessCodeKeyIcon, {}) })] }));
    }
    return (_jsx("div", { className: 'seam-issue-icon-wrap', children: _jsx(AccessCodeKeyIcon, {}) }));
}
const t = {
    codeIssue: 'code issue',
    codeIssues: 'code issues',
};
//# sourceMappingURL=AccessCodeMainIcon.js.map