2024-07-08 11:44:39 -04:00
|
|
|
<script lang="ts">
|
|
|
|
import { toasts } from '$lib/toasts';
|
|
|
|
|
|
|
|
let toastList: any[] = [];
|
|
|
|
|
|
|
|
toasts.subscribe((value) => {
|
|
|
|
toastList = value;
|
|
|
|
console.log(toastList);
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<div class="toast toast-top toast-end z-50 min-w-20">
|
|
|
|
{#each toastList as { type, message, id, duration }}
|
2024-08-14 22:17:43 -04:00
|
|
|
{#if type == 'success'}
|
|
|
|
<div class="alert alert-success">
|
|
|
|
<span>{message}</span>
|
|
|
|
</div>
|
|
|
|
{/if}
|
|
|
|
{#if type == 'error'}
|
|
|
|
<div class="alert alert-error">
|
|
|
|
<span>{message}</span>
|
|
|
|
</div>
|
|
|
|
{/if}
|
|
|
|
{#if type == 'info'}
|
|
|
|
<div class="alert alert-info">
|
|
|
|
<span>{message}</span>
|
|
|
|
</div>
|
|
|
|
{/if}
|
|
|
|
{#if type == 'warning'}
|
|
|
|
<div class="alert alert-warning">
|
|
|
|
<span>{message}</span>
|
|
|
|
</div>
|
|
|
|
{/if}
|
2024-07-08 11:44:39 -04:00
|
|
|
{/each}
|
|
|
|
</div>
|