Adjust types for Image.svelte
This commit is contained in:
parent
72452acf2c
commit
4bced28e3e
1 changed files with 48 additions and 42 deletions
|
@ -13,9 +13,9 @@
|
||||||
|
|
||||||
let {
|
let {
|
||||||
image,
|
image,
|
||||||
tags = [],
|
tags,
|
||||||
class: className
|
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');
|
let badgeVariant: BadgeVariant = $derived($mode == 'dark' ? 'secondary' : 'default');
|
||||||
</script>
|
</script>
|
||||||
|
@ -36,6 +36,7 @@
|
||||||
</span>
|
</span>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
|
|
||||||
|
{#if image}
|
||||||
<div
|
<div
|
||||||
class="projectCardImage grid justify-items-center overflow-hidden rounded-md bg-primary shadow-lg"
|
class="projectCardImage grid justify-items-center overflow-hidden rounded-md bg-primary shadow-lg"
|
||||||
>
|
>
|
||||||
|
@ -76,12 +77,17 @@
|
||||||
)}
|
)}
|
||||||
</a>
|
</a>
|
||||||
{:else}
|
{: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}
|
{/if}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
{/if}
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.projectCardImage > * {
|
.projectCardImage > * {
|
||||||
|
|
Loading…
Add table
Reference in a new issue