"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const jsx_runtime_1 = require("react/jsx-runtime");
const react_1 = require("react");
const badge_1 = __importDefault(require("../badge"));
const box_1 = __importDefault(require("../box"));
const icon_1 = __importDefault(require("../icon"));
const t_1 = __importDefault(require("../t"));
const SidemenuItemContent = (0, react_1.memo)(({ icon, iconSize = 'sm', title, isMenuExpanded, isInPopover, badge, badgeLinkUrl }) => {
    var _a, _b;
    const iconBaseMarginLeft = 13 / 8;
    const iconMarginRight = isMenuExpanded ? 10 / 8 : 20 / 8;
    if (isInPopover)
        return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(t_1.default, { isTruncated: true, size: "sm", display: "inline-block", fontWeight: "500", ml: iconBaseMarginLeft, children: title }), badge && typeof badge === 'object' && typeof badge.text === 'string' && badge.text.trim() !== '' && ((0, jsx_runtime_1.jsx)(badge_1.default, Object.assign({}, badge, { "data-link": btoa(badgeLinkUrl !== null && badgeLinkUrl !== void 0 ? badgeLinkUrl : '#'), variant: (_a = badge.variant) !== null && _a !== void 0 ? _a : 'subtleGreen', size: "sm", minW: "32px", fontSize: "12px", lineHeight: "16px", ml: "10px", mr: "10px" })))] }));
    return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(box_1.default, { ml: iconBaseMarginLeft, mr: iconMarginRight, w: "20px", transition: "margin 0.2s ease-in-out", children: icon && (0, jsx_runtime_1.jsx)(icon_1.default, { name: icon, size: iconSize }) }), (0, jsx_runtime_1.jsx)(t_1.default, { isTruncated: true, size: "sm", display: "inline-block", children: title }), badge && typeof badge === 'object' && typeof badge.text === 'string' && badge.text.trim() !== '' && ((0, jsx_runtime_1.jsx)(badge_1.default, Object.assign({}, badge, { "data-link": btoa(badgeLinkUrl !== null && badgeLinkUrl !== void 0 ? badgeLinkUrl : '#'), variant: (_b = badge.variant) !== null && _b !== void 0 ? _b : 'subtleGreen', size: "sm", minW: "32px", fontSize: "12px", lineHeight: "16px", ml: "10px", mr: "10px" })))] }));
});
SidemenuItemContent.displayName = 'SidemenuItemContent';
exports.default = SidemenuItemContent;
//# sourceMappingURL=SidemenuItemContent.js.map