-
Notifications
You must be signed in to change notification settings - Fork 103
/
Confirmation.svelte
36 lines (33 loc) · 1.23 KB
/
Confirmation.svelte
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<script lang="ts">
import { localize } from '@core/i18n'
import { Button, ButtonVariant, Text, TextHint } from '@ui'
export let description: string = ''
export let hint: string = ''
export let info: boolean = false
export let success: boolean = false
export let warning: boolean = false
export let danger: boolean = false
export let confirmText: string = localize('actions.confirm')
export let onConfirm: () => void = undefined
export let onCancel: () => void = undefined
</script>
<div class="w-full h-full space-y-6 flex flex-auto flex-col flex-shrink-0">
<div class="space-y-4">
{#if description}
<Text fontSize="14" classes="text-left">{description}</Text>
{/if}
{#if hint}
<TextHint {info} {success} {warning} {danger} text={hint} />
{/if}
</div>
<div class="flex flex-row justify-between w-full space-x-4">
<Button classes="w-1/2" outline onClick={onCancel}>{localize('actions.cancel')}</Button>
<Button
classes="w-1/2"
variant={warning || danger ? ButtonVariant.Warning : ButtonVariant.Primary}
onClick={onConfirm}
>
{confirmText}
</Button>
</div>
</div>