<script>
import {NotificationService} from "@dflare/svelte-enhanced-notifications";
import {pushNotification} from "@dflare/svelte-enhanced-notifications";
let notficationServiceTop;
let notficationServiceCenter;
let notficationServiceBottom;
// The shared notification container among the NotificationService components
let notifications = [];
let myNotification = {
title: "Success notification",
message: "This is a success notification",
variant: "success",
autoDismissible: true,
showCountdown: true
};
function showNotification() {
notifications = pushNotification(myNotification, notifications);
}
</script>
<NotificationService bind:this={notficationServiceTop} bind:notifications={notifications} location="top"/>
<NotificationService bind:this={notficationServiceCenter} bind:notifications={notifications} location="center"/>
<NotificationService bind:this={notficationServiceBottom} bind:notifications={notifications} location="bottom"/>
<button on:click={showNotification}>Show Notification</button>