This repository has been archived on 2024-03-28. You can view files and clone it, but cannot push or open issues or pull requests.
atsebay.t/ui/src/lib/components/Toaster.svelte
Pierre-Olivier Mercier d6f620bc0d ui: Use $lib in imports
2022-11-19 11:44:31 +01:00

19 lines
689 B
Svelte

<script>
import { ToastsStore } from '$lib/stores/toasts';
</script>
<div class="toast-container position-fixed top-0 end-0 p-3">
{#each $ToastsStore.toasts as toast}
<div class="toast show" role="alert">
<div class="toast-header">
<div class="bg-{toast.color} rounded me-2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div>
<strong>{#if toast.title}{toast.title}{:else}Questionnaire{/if}</strong>
<button type="button" class="btn-close" data-bs-dismiss="toast" aria-label="Close"></button>
</div>
<div class="toast-body">
{toast.msg}
</div>
</div>
{/each}
</div>