import { jsx } from "react/jsx-runtime";
import { Chip, styled } from "@mui/material";
import apollo_core from "@uipath/apollo-core";
import react from "react";
import { BadgeSize } from "./ApBadge.types.js";
const StyledBadge = styled(Chip, {
    shouldForwardProp: (prop)=>'badgeSize' !== prop && 'badgeStatus' !== prop
})(({ badgeSize, badgeStatus })=>{
    let backgroundColor;
    let textColor;
    switch(badgeStatus){
        case 'error':
            backgroundColor = 'var(--color-error-background)';
            textColor = 'var(--color-error-text)';
            break;
        case 'warning':
            backgroundColor = 'var(--color-warning-background)';
            textColor = 'var(--color-warning-text)';
            break;
        case 'info':
            backgroundColor = 'var(--color-info-background)';
            textColor = 'var(--color-info-text)';
            break;
        case 'success':
            backgroundColor = 'var(--color-success-background)';
            textColor = 'var(--color-success-text)';
            break;
        default:
            backgroundColor = 'var(--color-background-secondary)';
            textColor = 'var(--color-foreground)';
    }
    return {
        backgroundColor,
        color: textColor,
        fontWeight: apollo_core.FontFamily.FontWeightSemibold,
        height: 'small' === badgeSize ? apollo_core.Spacing.SpacingBase : apollo_core.Spacing.SpacingL,
        fontSize: 'small' === badgeSize ? apollo_core.FontFamily.FontXsSize : apollo_core.FontFamily.FontMSize,
        lineHeight: 'small' === badgeSize ? apollo_core.FontFamily.FontSLineHeight : apollo_core.FontFamily.FontMLineHeight,
        padding: 'small' === badgeSize ? `${apollo_core.Padding.PadXs} ${apollo_core.Padding.PadL}` : `${apollo_core.Padding.PadS} ${apollo_core.Padding.PadL}`,
        '.MuiChip-label': {
            padding: 'small' === badgeSize ? '0' : `${apollo_core.Spacing.SpacingMicro} ${apollo_core.Spacing.SpacingS}`
        },
        '&.MuiChip-root:hover': {
            backgroundColor
        }
    };
});
const ApBadge = /*#__PURE__*/ react.forwardRef(({ label, size = BadgeSize.SMALL, status = 'default', className, style }, ref)=>/*#__PURE__*/ jsx(StyledBadge, {
        ref: ref,
        label: label,
        badgeSize: size,
        badgeStatus: status,
        className: className,
        style: style
    }));
ApBadge.displayName = 'ApBadge';
export { ApBadge };
