import React, { useMemo } from 'react';
import { StatusToast } from '@wix/design-system';
const toastTypeToStatus = {
    STANDARD: 'info',
    PREMIUM: 'info',
    SUCCESS: 'success',
    WARNING: 'warning',
    ERROR: 'error',
};
export const ManageTagsNotification = ({ toastConfig, onClose, dataHook, }) => {
    const actionElement = useMemo(() => {
        if (!toastConfig.action?.text) {
            return undefined;
        }
        const handleClick = () => {
            toastConfig.action?.onClick?.();
            if (toastConfig.action?.removeToastOnClick) {
                onClose(toastConfig);
            }
        };
        return (React.createElement(StatusToast.Action, { dataHook: "manage-tags-modal-notification-action", onClick: handleClick }, toastConfig.action.text));
    }, [toastConfig, onClose]);
    return (React.createElement(StatusToast, { key: toastConfig.biName ?? toastConfig.message, dataHook: dataHook, status: toastTypeToStatus[toastConfig.type ?? 'STANDARD'], dismissible: true, onDismiss: () => onClose(toastConfig), action: actionElement },
        React.createElement("span", { "data-hook": "manage-tags-modal-notification-message" }, toastConfig.message)));
};
//# sourceMappingURL=ManageTagsNotification.js.map