var __rest = (this && this.__rest) || function (s, e) {
    var t = {};
    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
        t[p] = s[p];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
                t[p[i]] = s[p[i]];
        }
    return t;
};
import React from 'react';
import { makeStyles, Button } from '@material-ui/core';
import { Alert, AlertTitle } from '@material-ui/lab';
import clsx from 'clsx';
const useStyles = makeStyles(theme => ({
    root: {},
    '@global': {
        '.MuiPaper-rounded': {
            borderRadius: 0,
        },
    },
    alertSuccess: {
        borderLeft: `4px solid ${theme.palette.success.main}`,
    },
    alertWarning: {
        borderLeft: `4px solid ${theme.palette.warning.main}`,
    },
    alertError: {
        borderLeft: `4px solid ${theme.palette.error.main}`,
        color: theme.palette.error.main,
    },
    alertInfo: {
        borderLeft: `4px solid ${theme.palette.info.main}`,
    },
    square: {
        borderRadius: 0,
    },
}));
export const AmbientAlert = (_a) => {
    var { alertButton, alertMessage, alertTitle, showAlert, alertSeverity, closeAlert, alertAction, alertActionButton, alertHandleAction } = _a, otherProps = __rest(_a, ["alertButton", "alertMessage", "alertTitle", "showAlert", "alertSeverity", "closeAlert", "alertAction", "alertActionButton", "alertHandleAction"]);
    const classes = useStyles();
    const alertColor = () => {
        if (alertSeverity === 'success') {
            let alertLevel = classes.alertSuccess;
            return alertLevel;
        }
        else if (alertSeverity === 'warning') {
            let alertLevel = classes.alertWarning;
            return alertLevel;
        }
        else if (alertSeverity === 'error') {
            let alertLevel = classes.alertError;
            return alertLevel;
        }
        else if (alertSeverity === 'info') {
            let alertLevel = classes.alertInfo;
            return alertLevel;
        }
    };
    return (React.createElement("div", null, showAlert && (React.createElement(Alert, Object.assign({ classes: { root: clsx(alertColor(), classes.square) } }, otherProps, { severity: alertSeverity, onClose: closeAlert, action: alertAction ? (React.createElement(Button, { onClick: alertHandleAction, id: "udpRecord-AmbientAlert-alertActionButton", udprecordid: "udpRecord-AmbientAlert-alertActionButton" }, alertActionButton)) : null }), alertTitle && React.createElement(AlertTitle, null, alertTitle), alertMessage))));
};
//# sourceMappingURL=AmbientAlert.js.map