Adjust types for Image.svelte

This commit is contained in:
Mihkel Martin Kasterpalu 2025-02-06 01:36:54 +02:00
parent 72452acf2c
commit 4bced28e3e

View file

@ -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');
</script>
@ -36,6 +36,7 @@
</span>
{/snippet}
{#if image}
<div
class="projectCardImage grid justify-items-center overflow-hidden rounded-md bg-primary shadow-lg"
>
@ -76,12 +77,17 @@
)}
</a>
{:else}
{@render creditText(image.credit.author, image.credit.type, 'w-4 inline align-[-0.65em]')}
{@render creditText(
image.credit.author,
image.credit.type,
'w-4 inline align-[-0.65em]'
)}
{/if}
</p>
</div>
{/if}
</div>
{/if}
<style>
.projectCardImage > * {