Files
flotilla/src/app/components/Toast.svelte
T
2024-08-23 13:33:36 -07:00

20 lines
453 B
Svelte

<script lang="ts">
import {fly} from "@lib/transition"
import {toast} from "@app/toast"
</script>
{#if $toast}
{@const theme = $toast.theme || "info"}
{#key $toast.id}
<div transition:fly class="toast z-toast">
<div
role="alert"
class="alert flex justify-center"
class:alert-info={theme === "info"}
class:alert-error={theme === "error"}>
{$toast.message}
</div>
</div>
{/key}
{/if}