mirror of
https://github.com/immich-app/immich.git
synced 2026-05-18 03:10:24 +03:00
refactor: clean class (#26885)
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { cleanClass } from '$lib';
|
||||
import BrokenAsset from '$lib/components/assets/broken-asset.svelte';
|
||||
|
||||
interface Props {
|
||||
@@ -8,7 +9,7 @@
|
||||
class?: string;
|
||||
}
|
||||
|
||||
let { alt, preload = false, src, class: className = '' }: Props = $props();
|
||||
let { alt, preload = false, src, class: className }: Props = $props();
|
||||
|
||||
let isBroken = $state(false);
|
||||
</script>
|
||||
@@ -19,7 +20,7 @@
|
||||
<img
|
||||
{alt}
|
||||
onerror={() => (isBroken = true)}
|
||||
class="size-full rounded-xl object-cover aspect-square {className}"
|
||||
class={cleanClass('size-full rounded-xl object-cover aspect-square', className)}
|
||||
data-testid="album-image"
|
||||
draggable="false"
|
||||
loading={preload ? 'eager' : 'lazy'}
|
||||
|
||||
@@ -1,16 +1,18 @@
|
||||
<script lang="ts">
|
||||
import { cleanClass } from '$lib';
|
||||
|
||||
interface Props {
|
||||
alt?: string;
|
||||
preload?: boolean;
|
||||
class?: string;
|
||||
}
|
||||
|
||||
let { alt = '', preload = false, class: className = '' }: Props = $props();
|
||||
let { alt = '', preload = false, class: className }: Props = $props();
|
||||
</script>
|
||||
|
||||
<enhanced:img
|
||||
{alt}
|
||||
class="size-full rounded-xl object-cover aspect-square {className}"
|
||||
class={cleanClass('size-full rounded-xl object-cover aspect-square', className)}
|
||||
data-testid="album-image"
|
||||
draggable="false"
|
||||
loading={preload ? 'eager' : 'lazy'}
|
||||
|
||||
Reference in New Issue
Block a user