"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Alert = void 0;
const tslib_1 = require("tslib");
const react_1 = require("@emotion/react");
const styled_1 = tslib_1.__importDefault(require("@emotion/styled"));
const React = tslib_1.__importStar(require("react"));
const ai_1 = require("react-icons/ai");
const Alert = ({ type, showIcon, message, style, }) => {
    return (React.createElement(StyledAlert, { type: type, style: style },
        showIcon && (React.createElement(AlertIcon, { type: type }, {
            info: React.createElement(ai_1.AiFillInfoCircle, null),
            warning: React.createElement(ai_1.AiFillWarning, null),
            success: React.createElement(ai_1.AiFillCheckCircle, null),
            error: React.createElement(ai_1.AiFillExclamationCircle, null),
        }[type])),
        message));
};
exports.Alert = Alert;
const AlertIcon = styled_1.default.div `
  //
  margin-right: 8px;
  ${({ type = "info" }) => {
    return {
        info: (0, react_1.css) `
        color: #1890ff;
      `,
        warning: (0, react_1.css) `
        color: #faad14;
      `,
        success: (0, react_1.css) `
        color: #52c41a;
      `,
        error: (0, react_1.css) `
        color: #ff4d4f;
      `,
    }[type];
}}
`;
const StyledAlert = styled_1.default.div `
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  color: rgba(0, 0, 0, 0.85);
  font-size: 14px;
  font-variant: tabular-nums;
  line-height: 1.5715;
  list-style: none;
  font-feature-settings: "tnum";
  position: relative;
  display: flex;
  align-items: center;
  padding: 8px 15px;
  word-wrap: break-word;
  border-radius: 2px;
  ${({ type = "info" }) => {
    return {
        info: (0, react_1.css) `
        background-color: #e6f7ff;
        border: 1px solid #91d5ff;
      `,
        warning: (0, react_1.css) `
        background-color: #fffbe6;
        border: 1px solid #ffe58f;
      `,
        success: (0, react_1.css) `
        background-color: #f6ffed;
        border: 1px solid #b7eb8f;
      `,
        error: (0, react_1.css) `
        background-color: #fff2f0;
        border: 1px solid #ffccc7;
      `,
    }[type];
}}
`;
//# sourceMappingURL=Alert.js.map