2024-08-02 16:36:21 +02:00
|
|
|
<script lang="ts">
|
|
|
|
|
const { success, message } = $props<{
|
|
|
|
|
success: boolean | undefined;
|
|
|
|
|
message: string;
|
|
|
|
|
}>();
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
{#if success}
|
|
|
|
|
<p class="toast success">{message}</p>
|
|
|
|
|
{/if}
|
|
|
|
|
|
|
|
|
|
{#if success === false}
|
|
|
|
|
<p class="toast error">{message}</p>
|
|
|
|
|
{/if}
|
|
|
|
|
|
|
|
|
|
<style>
|
|
|
|
|
.toast {
|
|
|
|
|
position: fixed;
|
2024-08-15 16:26:32 +02:00
|
|
|
inset-block-end: var(--space-s);
|
|
|
|
|
inset-inline-end: var(--space-s);
|
|
|
|
|
margin-inline-start: var(--space-s);
|
|
|
|
|
padding-inline: var(--space-xs);
|
|
|
|
|
padding-block: var(--space-2xs);
|
|
|
|
|
text-align: center;
|
2024-08-02 16:36:21 +02:00
|
|
|
border-radius: var(--border-radius);
|
|
|
|
|
color: var(--color-text-invert);
|
|
|
|
|
z-index: 30;
|
|
|
|
|
animation: toast 3s forwards;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.success {
|
|
|
|
|
background-color: var(--color-success);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.error {
|
|
|
|
|
background-color: var(--color-error);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@keyframes toast {
|
|
|
|
|
0%,
|
|
|
|
|
90% {
|
|
|
|
|
opacity: 1;
|
|
|
|
|
}
|
|
|
|
|
100% {
|
|
|
|
|
opacity: 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|