Files
flotilla/src/lib/components/ImageIcon.svelte
T
2025-11-11 13:50:45 -08:00

19 lines
436 B
Svelte

<script lang="ts">
import Icon from "@lib/components/Icon.svelte"
type Props = {
src: string
alt: string
size?: number
class?: string
}
const {src, alt, size = 5, ...props}: Props = $props()
</script>
{#if src.includes("image/svg") || src.endsWith(".svg")}
<Icon icon={src} {size} class={props.class} />
{:else}
<img {src} {alt} class="h-{size} w-{size} aspect-square object-cover {props.class}" />
{/if}