Files
immich/web/src/lib/components/sharedlinks-page/covers/share-cover.svelte

32 lines
1.0 KiB
Svelte
Raw Normal View History

<script lang="ts">
import AlbumCover from '$lib/components/album-page/album-cover.svelte';
import AssetCover from '$lib/components/sharedlinks-page/covers/asset-cover.svelte';
2025-11-10 12:21:26 -05:00
import NoCover from '$lib/components/sharedlinks-page/covers/no-cover.svelte';
import { getAssetThumbnailUrl } from '$lib/utils';
2025-11-10 12:21:26 -05:00
import type { SharedLinkResponseDto } from '@immich/sdk';
import { t } from 'svelte-i18n';
interface Props {
2025-11-10 12:21:26 -05:00
sharedLink: SharedLinkResponseDto;
preload?: boolean;
class?: string;
}
2025-11-10 12:21:26 -05:00
let { sharedLink, preload = false, class: className = '' }: Props = $props();
</script>
<div class="relative shrink-0 size-24">
2025-11-10 12:21:26 -05:00
{#if sharedLink?.album}
<AlbumCover album={sharedLink.album} class={className} {preload} />
{:else if sharedLink.assets[0]}
<AssetCover
alt={$t('individual_share')}
class={className}
{preload}
2025-11-10 12:21:26 -05:00
src={getAssetThumbnailUrl(sharedLink.assets[0].id)}
/>
{:else}
<NoCover alt={$t('unnamed_share')} class={className} {preload} />
{/if}
</div>