mirror of
https://github.com/MewoLab/AquaDX.git
synced 2026-02-07 03:47:28 +08:00
[F] Fix TS errors
This commit is contained in:
34
AquaNet/src/components/Confirm.svelte
Normal file
34
AquaNet/src/components/Confirm.svelte
Normal 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>
|
||||
Reference in New Issue
Block a user