import React__default from 'react';
import { css } from 'styled-components';
import { getColorAlias } from '../../utils/index.js';
import { IconWrapper } from './styles.js';
import AlertCircle from '../../icons/AlertCircle.js';
import AlertTriangle from '../../icons/AlertTriangle.js';
import CheckCircle from '../../icons/CheckCircle.js';
import InfoCircle from '../../icons/InfoCircle.js';

function mapTypeToCss(type) {
    switch (type) {
        case 'neutral':
            return css `
        background-color: ${getColorAlias('containerSubtle')};
      `;
        case 'neutral-alternative':
            return css `
        background-color: ${getColorAlias('containerDefault')};
      `;
        case 'info':
            return css `
        background-color: ${getColorAlias('supportInfo02')};

        ${IconWrapper} > svg {
          fill: ${getColorAlias('supportInfo')};
        }
      `;
        case 'positive':
            return css `
        background-color: ${getColorAlias('supportPositive02')};

        ${IconWrapper} > svg {
          fill: ${getColorAlias('supportPositive')};
        }
      `;
        case 'warning':
            return css `
        background-color: ${getColorAlias('supportWarning02')};

        ${IconWrapper} > svg {
          fill: ${getColorAlias('supportWarning')};
        }
      `;
        case 'error':
            return css `
        background-color: ${getColorAlias('supportError02')};

        ${IconWrapper} > svg {
          fill: ${getColorAlias('supportError')};
        }
      `;
    }
}
function getIcon(icon, type) {
    if (icon || icon === null)
        return icon;
    switch (type) {
        case 'neutral':
        case 'neutral-alternative':
            return icon;
        case 'info':
            return React__default.createElement(InfoCircle, { role: "img", "aria-label": "info-icon" });
        case 'positive':
            return React__default.createElement(CheckCircle, { role: "img", "aria-label": "positive-icon" });
        case 'warning':
            return React__default.createElement(AlertTriangle, { role: "img", "aria-label": "warning-icon" });
        case 'error':
            return React__default.createElement(AlertCircle, { role: "img", "aria-label": "error-icon" });
    }
}

export { getIcon, mapTypeToCss };
