refactor: shared-link service (#23770)

This commit is contained in:
Jason Rasmussen
2025-11-10 15:49:02 -05:00
committed by GitHub
parent 9e2208b8dd
commit dea95ac2e6
12 changed files with 128 additions and 163 deletions
@@ -1,10 +1,9 @@
<script lang="ts">
import SharedLinkCopy from '$lib/components/sharedlinks-page/actions/shared-link-copy.svelte';
import { handleShowSharedLinkQrCode } from '$lib/services/shared-link.service';
import ActionButton from '$lib/components/ActionButton.svelte';
import { getSharedLinkActions } from '$lib/services/shared-link.service';
import { locale } from '$lib/stores/preferences.store';
import type { AlbumResponseDto, SharedLinkResponseDto } from '@immich/sdk';
import { IconButton, Text } from '@immich/ui';
import { mdiQrcode } from '@mdi/js';
import { Text } from '@immich/ui';
import { DateTime } from 'luxon';
import { t } from 'svelte-i18n';
@@ -32,6 +31,8 @@
]
.filter(Boolean)
.join(' • ');
const SharedLinkActions = $derived(getSharedLinkActions($t, sharedLink));
</script>
<div class="flex justify-between items-center">
@@ -40,14 +41,7 @@
<Text size="tiny" color="muted">{getShareProperties()}</Text>
</div>
<div class="flex">
<IconButton
aria-label={$t('view_qr_code')}
shape="round"
color="secondary"
variant="ghost"
icon={mdiQrcode}
onclick={() => handleShowSharedLinkQrCode(sharedLink)}
/>
<SharedLinkCopy {sharedLink} />
<ActionButton action={SharedLinkActions.ViewQrCode} />
<ActionButton action={SharedLinkActions.Copy} />
</div>
</div>