[F] Fix TS errors

This commit is contained in:
Azalea
2024-02-22 19:00:14 -05:00
parent f5c2dc747d
commit 50029fbb24
2 changed files with 51 additions and 15 deletions

View File

@@ -0,0 +1,34 @@
<!-- Svelte 4.2.11 -->
<script lang="ts">
import { fade } from 'svelte/transition'
interface ConfirmProps {
title: string
message: string
confirm: () => void
cancel?: () => void
}
// Props
export let show: ConfirmProps
</script>
{#if show}
<div class="overlay" transition:fade>
<h1>{show.title}</h1>
<span>{show.message}</span>
<div class="actions">
{#if show.cancel}
<!-- Svelte LSP is very annoying here -->
<button on:click={() => show.cancel && show.cancel()}>Cancel</button>
{/if}
<button on:click={() => show.confirm()}>Confirm</button>
</div>
</div>
{/if}
<style lang="sass">
</style>