"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.NotificationTemplate = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const CrossOutlineMd_1 = require("../../../icons/CrossOutlineMd");
const styles_1 = require("../styles");
const styles_2 = require("./styles");
const mapOfNotificationIcons = {
    info: styles_1.InfoNotificationIcon,
    success: styles_1.SuccessNotificationIcon,
    warning: styles_1.WarningNotificationIcon,
    error: styles_1.ErrorNotificationIcon,
};
const DefaultIcon = ({ variant }) => {
    const Icon = mapOfNotificationIcons[variant];
    return (0, jsx_runtime_1.jsx)(Icon, {});
};
const NotificationTemplate = ({ icon, title, closeToast, content, actions, variant, actionsDirection = 'right', showCloseButton = true, }) => {
    const handleCloseToast = () => closeToast?.();
    return ((0, jsx_runtime_1.jsxs)(styles_2.Wrapper, { variant: variant, children: [(0, jsx_runtime_1.jsx)(styles_2.IconWrapper, { children: icon || (0, jsx_runtime_1.jsx)(DefaultIcon, { variant: variant }) }), (0, jsx_runtime_1.jsxs)(styles_2.Inner, { children: [(0, jsx_runtime_1.jsxs)(styles_2.Header, { children: [(0, jsx_runtime_1.jsx)(styles_2.Title, { variant: "h5", children: title }), showCloseButton && ((0, jsx_runtime_1.jsx)(styles_2.CloseButton, { onClick: handleCloseToast, color: "grey", variant: "text", children: (0, jsx_runtime_1.jsx)(CrossOutlineMd_1.CrossOutlineMd, {}) }))] }), content && (0, jsx_runtime_1.jsx)(styles_2.Content, { variant: "body1", children: content }), actions && ((0, jsx_runtime_1.jsx)(styles_2.Footer, { actionsDirection: actionsDirection, children: actions }))] })] }));
};
exports.NotificationTemplate = NotificationTemplate;
