immich/web/src/lib/components/photos-page/delete-asset-dialog.svelte

47 lines
1.3 KiB
Svelte
Raw Normal View History

<script lang="ts">
import { createEventDispatcher } from 'svelte';
import ConfirmDialog from '../shared-components/dialog/confirm-dialog.svelte';
import { showDeleteModal } from '$lib/stores/preferences.store';
import Checkbox from '$lib/components/elements/checkbox.svelte';
2024-05-22 09:33:37 -04:00
import { s } from '$lib/utils';
export let size: number;
let checked = false;
const dispatch = createEventDispatcher<{
confirm: void;
cancel: void;
}>();
const handleConfirm = () => {
if (checked) {
$showDeleteModal = false;
}
dispatch('confirm');
};
</script>
<ConfirmDialog
2024-05-22 09:33:37 -04:00
title="Permanently delete asset{s(size)}"
confirmText="Delete"
onConfirm={handleConfirm}
onCancel={() => dispatch('cancel')}
>
<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>
<div class="pt-4 flex justify-center items-center">
<Checkbox id="confirm-deletion-input" label="Do not show this message again" bind:checked />
</div>
</svelte:fragment>
</ConfirmDialog>