mirror of
https://github.com/immich-app/immich.git
synced 2025-12-22 09:15:34 +03:00
32 lines
1.0 KiB
Svelte
32 lines
1.0 KiB
Svelte
<script lang="ts">
|
|
import AlbumCover from '$lib/components/album-page/album-cover.svelte';
|
|
import AssetCover from '$lib/components/sharedlinks-page/covers/asset-cover.svelte';
|
|
import NoCover from '$lib/components/sharedlinks-page/covers/no-cover.svelte';
|
|
import { getAssetThumbnailUrl } from '$lib/utils';
|
|
import type { SharedLinkResponseDto } from '@immich/sdk';
|
|
import { t } from 'svelte-i18n';
|
|
|
|
interface Props {
|
|
sharedLink: SharedLinkResponseDto;
|
|
preload?: boolean;
|
|
class?: string;
|
|
}
|
|
|
|
let { sharedLink, preload = false, class: className = '' }: Props = $props();
|
|
</script>
|
|
|
|
<div class="relative shrink-0 size-24">
|
|
{#if sharedLink?.album}
|
|
<AlbumCover album={sharedLink.album} class={className} {preload} />
|
|
{:else if sharedLink.assets[0]}
|
|
<AssetCover
|
|
alt={$t('individual_share')}
|
|
class={className}
|
|
{preload}
|
|
src={getAssetThumbnailUrl(sharedLink.assets[0].id)}
|
|
/>
|
|
{:else}
|
|
<NoCover alt={$t('unnamed_share')} class={className} {preload} />
|
|
{/if}
|
|
</div>
|