Files
personal-website/src/lib/map-finder/Artwork.svelte
Stan Runge 4b63e9ca11
All checks were successful
Test and deploy staging / staging (push) Successful in 1m46s
remove emojis with real icons
2026-09-23 16:12:41 +00:00

25 lines
630 B
Svelte

<script lang="ts">
import Music2 from 'lucide-svelte/icons/music-2';
let { src, class: className = '' }: { src?: string; class?: string } = $props();
let failed = $state(false);
$effect(() => {
void src;
failed = false;
});
</script>
<div class={`overflow-hidden rounded bg-gray-200 ${className}`}>
{#if src?.startsWith('https://') && !failed}<img
{src}
alt=""
class="h-full w-full object-cover"
loading="lazy"
onerror={() => (failed = true)}
/>{:else}<div
class="flex h-full items-center justify-center text-2xl text-gray-500"
aria-hidden="true"
>
<Music2 size={28} />
</div>{/if}
</div>