mirror of
https://github.com/immich-app/immich.git
synced 2026-05-18 03:10:24 +03:00
refactor: use new web service architecture (1/2)
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
<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';
|
||||
|
||||
interface 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));
|
||||
|
||||
function onIntegrityReportDelete({
|
||||
id: reportId,
|
||||
type,
|
||||
isDeleting,
|
||||
}: {
|
||||
id?: string;
|
||||
type?: IntegrityReportType;
|
||||
isDeleting: boolean;
|
||||
}) {
|
||||
if (type === reportType || reportId === id) {
|
||||
deleting = isDeleting;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<OnEvents {onIntegrityReportDelete} />
|
||||
|
||||
<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>
|
||||
Reference in New Issue
Block a user