2024-01-17 20:18:04 +01:00
|
|
|
<script lang="ts">
|
2024-05-28 09:10:43 +07:00
|
|
|
import ConfirmDialog from '../shared-components/dialog/confirm-dialog.svelte';
|
2024-01-17 20:18:04 +01:00
|
|
|
import { showDeleteModal } from '$lib/stores/preferences.store';
|
2024-04-26 06:18:19 +00:00
|
|
|
import Checkbox from '$lib/components/elements/checkbox.svelte';
|
2024-06-04 21:53:00 +02:00
|
|
|
import { t } from 'svelte-i18n';
|
2024-07-01 18:54:13 +02:00
|
|
|
import FormatMessage from '$lib/components/i18n/format-message.svelte';
|
2024-01-17 20:18:04 +01:00
|
|
|
|
|
|
|
|
export let size: number;
|
2024-09-20 23:02:58 +02:00
|
|
|
export let onConfirm: () => void;
|
|
|
|
|
export let onCancel: () => void;
|
2024-01-17 20:18:04 +01:00
|
|
|
|
|
|
|
|
let checked = false;
|
|
|
|
|
|
|
|
|
|
const handleConfirm = () => {
|
|
|
|
|
if (checked) {
|
|
|
|
|
$showDeleteModal = false;
|
|
|
|
|
}
|
2024-09-20 23:02:58 +02:00
|
|
|
onConfirm();
|
2024-01-17 20:18:04 +01:00
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
|
2024-05-28 09:10:43 +07:00
|
|
|
<ConfirmDialog
|
2024-06-24 15:50:01 +02:00
|
|
|
title={$t('permanently_delete_assets_count', { values: { count: size } })}
|
2024-06-04 21:53:00 +02:00
|
|
|
confirmText={$t('delete')}
|
2024-03-07 04:18:53 +01:00
|
|
|
onConfirm={handleConfirm}
|
2024-09-20 23:02:58 +02:00
|
|
|
{onCancel}
|
2024-01-17 20:18:04 +01:00
|
|
|
>
|
|
|
|
|
<svelte:fragment slot="prompt">
|
|
|
|
|
<p>
|
2024-07-01 18:54:13 +02:00
|
|
|
<FormatMessage key="permanently_delete_assets_prompt" values={{ count: size }} let:message>
|
|
|
|
|
<b>{message}</b>
|
|
|
|
|
</FormatMessage>
|
2024-01-17 20:18:04 +01:00
|
|
|
</p>
|
2024-06-24 15:50:01 +02:00
|
|
|
<p><b>{$t('cannot_undo_this_action')}</b></p>
|
2024-01-17 20:18:04 +01:00
|
|
|
|
2024-04-26 06:18:19 +00:00
|
|
|
<div class="pt-4 flex justify-center items-center">
|
2024-06-24 15:50:01 +02:00
|
|
|
<Checkbox id="confirm-deletion-input" label={$t('do_not_show_again')} bind:checked />
|
2024-01-17 20:18:04 +01:00
|
|
|
</div>
|
|
|
|
|
</svelte:fragment>
|
2024-05-28 09:10:43 +07:00
|
|
|
</ConfirmDialog>
|