2024-01-17 20:18:04 +01:00
|
|
|
<script lang="ts">
|
|
|
|
|
import { createEventDispatcher } from 'svelte';
|
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-05-22 09:33:37 -04:00
|
|
|
import { s } from '$lib/utils';
|
2024-01-17 20:18:04 +01:00
|
|
|
|
|
|
|
|
export let size: number;
|
|
|
|
|
|
|
|
|
|
let checked = false;
|
|
|
|
|
|
|
|
|
|
const dispatch = createEventDispatcher<{
|
|
|
|
|
confirm: void;
|
|
|
|
|
cancel: void;
|
|
|
|
|
}>();
|
|
|
|
|
|
|
|
|
|
const handleConfirm = () => {
|
|
|
|
|
if (checked) {
|
|
|
|
|
$showDeleteModal = false;
|
|
|
|
|
}
|
|
|
|
|
dispatch('confirm');
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
|
2024-05-28 09:10:43 +07:00
|
|
|
<ConfirmDialog
|
2024-05-22 09:33:37 -04:00
|
|
|
title="Permanently delete asset{s(size)}"
|
2024-01-17 20:18:04 +01:00
|
|
|
confirmText="Delete"
|
2024-03-07 04:18:53 +01:00
|
|
|
onConfirm={handleConfirm}
|
2024-05-28 09:10:43 +07:00
|
|
|
onCancel={() => dispatch('cancel')}
|
2024-01-17 20:18:04 +01:00
|
|
|
>
|
|
|
|
|
<svelte:fragment slot="prompt">
|
|
|
|
|
<p>
|
|
|
|
|
Are you sure you want to permanently delete
|
|
|
|
|
{#if size > 1}
|
|
|
|
|
these <b>{size}</b> assets? This will also remove them from their album(s).
|
|
|
|
|
{:else}
|
|
|
|
|
this asset? This will also remove it from its album(s).
|
|
|
|
|
{/if}
|
|
|
|
|
</p>
|
|
|
|
|
<p><b>You cannot undo this action!</b></p>
|
|
|
|
|
|
2024-04-26 06:18:19 +00:00
|
|
|
<div class="pt-4 flex justify-center items-center">
|
|
|
|
|
<Checkbox id="confirm-deletion-input" label="Do not show this message again" bind:checked />
|
2024-01-17 20:18:04 +01:00
|
|
|
</div>
|
|
|
|
|
</svelte:fragment>
|
2024-05-28 09:10:43 +07:00
|
|
|
</ConfirmDialog>
|