'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var React = require('react');
var styled = require('styled-components');
var index = require('../../utils/index.js');
var styles = require('./styles.js');
var AlertCircle = require('../../icons/AlertCircle.js');
var AlertTriangle = require('../../icons/AlertTriangle.js');
var CheckCircle = require('../../icons/CheckCircle.js');
var InfoCircle = require('../../icons/InfoCircle.js');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var React__default = /*#__PURE__*/_interopDefaultLegacy(React);

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

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

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

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

        ${styles.IconWrapper} > svg {
          fill: ${index.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['default'].createElement(InfoCircle['default'], { role: "img", "aria-label": "info-icon" });
        case 'positive':
            return React__default['default'].createElement(CheckCircle['default'], { role: "img", "aria-label": "positive-icon" });
        case 'warning':
            return React__default['default'].createElement(AlertTriangle['default'], { role: "img", "aria-label": "warning-icon" });
        case 'error':
            return React__default['default'].createElement(AlertCircle['default'], { role: "img", "aria-label": "error-icon" });
    }
}

exports.getIcon = getIcon;
exports.mapTypeToCss = mapTypeToCss;
