mirror of
https://github.com/immich-app/immich.git
synced 2026-05-18 03:10:24 +03:00
bf17d8cbd1
fix: should provide arrow function to , oops! Signed-off-by: izzy <me@insrt.uk>
42 lines
1.2 KiB
Svelte
42 lines
1.2 KiB
Svelte
<script lang="ts">
|
|
import OnEvents from '$lib/components/OnEvents.svelte';
|
|
import { getIntegrityReportItemActions } from '$lib/services/integrity.service';
|
|
import type { IntegrityReportType } from '@immich/sdk';
|
|
import { ContextMenuButton, TableCell, TableRow } from '@immich/ui';
|
|
import { t } from 'svelte-i18n';
|
|
|
|
type Props = {
|
|
id: string;
|
|
path: string;
|
|
reportType: IntegrityReportType;
|
|
};
|
|
|
|
let { id, path, reportType }: Props = $props();
|
|
let deleting = $state(false);
|
|
|
|
const { Download, Delete } = $derived(getIntegrityReportItemActions($t, id, reportType));
|
|
|
|
const onIntegrityReportDeleteStatus = ({
|
|
id: reportId,
|
|
type,
|
|
isDeleting,
|
|
}: {
|
|
id?: string;
|
|
type?: IntegrityReportType;
|
|
isDeleting: boolean;
|
|
}) => {
|
|
if (type === reportType || reportId === id) {
|
|
deleting = isDeleting;
|
|
}
|
|
};
|
|
</script>
|
|
|
|
<OnEvents {onIntegrityReportDeleteStatus} />
|
|
|
|
<TableRow>
|
|
<TableCell class="w-7/8 text-left px-4">{path}</TableCell>
|
|
<TableCell class="w-1/8 flex justify-end">
|
|
<ContextMenuButton disabled={deleting} position="top-right" aria-label={$t('open')} items={[Download, Delete]} />
|
|
</TableCell>
|
|
</TableRow>
|