2025-02-07 16:38:20 -05:00
|
|
|
<script lang="ts">
|
|
|
|
|
import SharedLinkCopy from '$lib/components/sharedlinks-page/actions/shared-link-copy.svelte';
|
|
|
|
|
import { locale } from '$lib/stores/preferences.store';
|
|
|
|
|
import type { AlbumResponseDto, SharedLinkResponseDto } from '@immich/sdk';
|
2025-06-02 09:47:23 -05:00
|
|
|
import { IconButton, Text } from '@immich/ui';
|
2025-04-11 14:02:07 -04:00
|
|
|
import { mdiQrcode } from '@mdi/js';
|
2025-02-07 16:38:20 -05:00
|
|
|
import { DateTime } from 'luxon';
|
|
|
|
|
import { t } from 'svelte-i18n';
|
|
|
|
|
|
|
|
|
|
type Props = {
|
|
|
|
|
album: AlbumResponseDto;
|
|
|
|
|
sharedLink: SharedLinkResponseDto;
|
2025-04-11 14:02:07 -04:00
|
|
|
onViewQrCode: () => void;
|
2025-02-07 16:38:20 -05:00
|
|
|
};
|
|
|
|
|
|
2025-04-11 14:02:07 -04:00
|
|
|
const { album, sharedLink, onViewQrCode }: Props = $props();
|
2025-02-10 18:00:37 -06:00
|
|
|
|
|
|
|
|
const getShareProperties = () =>
|
|
|
|
|
[
|
|
|
|
|
DateTime.fromISO(sharedLink.createdAt).toLocaleString(
|
|
|
|
|
{
|
|
|
|
|
month: 'long',
|
|
|
|
|
day: 'numeric',
|
|
|
|
|
year: 'numeric',
|
|
|
|
|
},
|
|
|
|
|
{ locale: $locale },
|
|
|
|
|
),
|
|
|
|
|
sharedLink.allowUpload && $t('upload'),
|
|
|
|
|
sharedLink.allowDownload && $t('download'),
|
|
|
|
|
sharedLink.showMetadata && $t('exif').toUpperCase(),
|
|
|
|
|
sharedLink.password && $t('password'),
|
|
|
|
|
]
|
|
|
|
|
.filter(Boolean)
|
|
|
|
|
.join(' • ');
|
2025-02-07 16:38:20 -05:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<div class="flex justify-between items-center">
|
|
|
|
|
<div class="flex flex-col gap-1">
|
|
|
|
|
<Text size="small">{sharedLink.description || album.albumName}</Text>
|
2025-02-10 18:00:37 -06:00
|
|
|
<Text size="tiny" color="muted">{getShareProperties()}</Text>
|
2025-02-07 16:38:20 -05:00
|
|
|
</div>
|
2025-04-11 14:02:07 -04:00
|
|
|
<div class="flex">
|
2025-06-02 09:47:23 -05:00
|
|
|
<IconButton
|
|
|
|
|
aria-label={$t('view_qr_code')}
|
|
|
|
|
shape="round"
|
|
|
|
|
color="secondary"
|
|
|
|
|
variant="ghost"
|
|
|
|
|
icon={mdiQrcode}
|
|
|
|
|
onclick={onViewQrCode}
|
|
|
|
|
/>
|
2025-04-11 14:02:07 -04:00
|
|
|
<SharedLinkCopy link={sharedLink} />
|
|
|
|
|
</div>
|
2025-02-07 16:38:20 -05:00
|
|
|
</div>
|