import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
import { memo } from 'react';
import Badge from '../badge';
import Box from '../box';
import Icon from '../icon';
import T from '../t';
const SidemenuItemContent = memo(({ icon, iconSize = 'sm', title, isMenuExpanded, isInPopover, badge, badgeLinkUrl }) => {
    const iconBaseMarginLeft = 13 / 8;
    const iconMarginRight = isMenuExpanded ? 10 / 8 : 20 / 8;
    if (isInPopover)
        return (_jsxs(_Fragment, { children: [_jsx(T, { isTruncated: true, size: "sm", display: "inline-block", fontWeight: "500", ml: iconBaseMarginLeft, children: title }), badge && typeof badge === 'object' && typeof badge.text === 'string' && badge.text.trim() !== '' && (_jsx(Badge, { ...badge, "data-link": btoa(badgeLinkUrl ?? '#'), variant: badge.variant ?? 'subtleGreen', size: "sm", minW: "32px", fontSize: "12px", lineHeight: "16px", ml: "10px", mr: "10px" }))] }));
    return (_jsxs(_Fragment, { children: [_jsx(Box, { ml: iconBaseMarginLeft, mr: iconMarginRight, w: "20px", transition: "margin 0.2s ease-in-out", children: icon && _jsx(Icon, { name: icon, size: iconSize }) }), _jsx(T, { isTruncated: true, size: "sm", display: "inline-block", children: title }), badge && typeof badge === 'object' && typeof badge.text === 'string' && badge.text.trim() !== '' && (_jsx(Badge, { ...badge, "data-link": btoa(badgeLinkUrl ?? '#'), variant: badge.variant ?? 'subtleGreen', size: "sm", minW: "32px", fontSize: "12px", lineHeight: "16px", ml: "10px", mr: "10px" }))] }));
});
SidemenuItemContent.displayName = 'SidemenuItemContent';
export default SidemenuItemContent;
//# sourceMappingURL=SidemenuItemContent.js.map