diff --git a/src/lib/components/Image.svelte b/src/lib/components/Image.svelte index 09c9c49..36c03f1 100644 --- a/src/lib/components/Image.svelte +++ b/src/lib/components/Image.svelte @@ -13,9 +13,9 @@ let { image, - tags = [], + tags, class: className - }: { image: EnhancedImage; tags: Tag[]; class: string } = $props(); + }: { image: EnhancedImage | undefined; tags?: Tag[]; class?: string } = $props(); let badgeVariant: BadgeVariant = $derived($mode == 'dark' ? 'secondary' : 'default'); @@ -36,52 +36,58 @@ {/snippet} -
- {#if image.credit.href}
-
+ {#if image.credit}
+
+ {#if image.credit.href}
+
+ {@render creditText(
+ image.credit.author,
+ image.credit.type,
+ 'w-4 inline align-[-0.65em]'
+ )}
+
+ {:else}
{@render creditText(
image.credit.author,
image.credit.type,
'w-4 inline align-[-0.65em]'
)}
-
- {:else}
- {@render creditText(image.credit.author, image.credit.type, 'w-4 inline align-[-0.65em]')}
- {/if}
-