2025-10-31 23:18:58 +00:00
|
|
|
<script lang="ts">
|
|
|
|
|
import Icon from "@lib/components/Icon.svelte"
|
|
|
|
|
|
|
|
|
|
type Props = {
|
|
|
|
|
src: string
|
|
|
|
|
alt: string
|
2025-11-10 22:59:15 +00:00
|
|
|
size?: number
|
2025-11-11 21:39:32 +00:00
|
|
|
class?: string
|
2026-06-24 20:56:53 +00:00
|
|
|
style?: string
|
2025-10-31 23:18:58 +00:00
|
|
|
}
|
|
|
|
|
|
2026-06-24 20:56:53 +00:00
|
|
|
const {src, alt, size = 5, style = undefined, ...props}: Props = $props()
|
2025-10-31 23:18:58 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
{#if src.includes("image/svg") || src.endsWith(".svg")}
|
2026-06-24 20:56:53 +00:00
|
|
|
<Icon icon={src} {size} {style} class={props.class} />
|
2025-10-31 23:18:58 +00:00
|
|
|
{:else}
|
2025-12-02 21:49:04 +00:00
|
|
|
<img
|
|
|
|
|
{src}
|
|
|
|
|
{alt}
|
2026-06-24 20:56:53 +00:00
|
|
|
{style}
|
|
|
|
|
class="h-{size} w-{size} min-w-{size} min-h-{size} aspect-square object-cover rounded-full {props.class}" />
|
2025-10-31 23:18:58 +00:00
|
|
|
{/if}
|