flotilla/src/app/components/Toast.svelte

20 lines
453 B
Svelte
Raw Normal View History

2024-08-08 23:32:46 +00:00
<script lang="ts">
import {fly} from "@lib/transition"
import {toast} from "@app/toast"
</script>
{#if $toast}
2024-08-23 20:33:36 +00:00
{@const theme = $toast.theme || "info"}
2024-08-08 23:32:46 +00:00
{#key $toast.id}
<div transition:fly class="toast z-toast">
2024-08-16 17:50:38 +00:00
<div
role="alert"
class="alert flex justify-center"
2024-08-23 20:33:36 +00:00
class:alert-info={theme === "info"}
class:alert-error={theme === "error"}>
2024-08-08 23:32:46 +00:00
{$toast.message}
</div>
</div>
{/key}
{/if}