Files
flotilla/src/lib/components/ImageIcon.svelte
T
2025-12-02 13:49:04 -08:00

22 lines
474 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} min-w-{size} min-h-{size} aspect-square object-cover {props.class}" />
{/if}