import { CheckSuccessIcon, ErrorIcon } from './icons';
const getIconForType = (type) => {
    return type === 'success' ? CheckSuccessIcon : ErrorIcon;
};
export const toastTemplate = (config) => {
    const { type, message, button } = config;
    const icon = getIconForType(type);
    const sessionButton = getButtonTemplate(button);
    return `<div class="mp-toast-content">
    <div class="mp-toast-icon">${icon}</div>
    <div class="mp-toast-message">${message}</div>
      ${sessionButton}
  </div>
  `;
};
const getButtonTemplate = (button) => {
    if (!button)
        return '';
    if (button.url)
        return `<a href="${button.url}" target="_blank" rel="noopener noreferrer" class="mp-toast-button">${button.text}</a>`;
    if (button.onClick)
        return `<button class="mp-toast-button">${button.text}</button>`;
    return '';
};
//# sourceMappingURL=toast.js.map