Foxnouns.NET/Foxnouns.Frontend/src/lib/components/Avatar.svelte

15 lines
351 B
Svelte
Raw Normal View History

<script lang="ts">
import { DEFAULT_AVATAR } from "$lib";
2024-11-24 17:36:02 +01:00
type Props = { url: string | null; alt: string; lazyLoad?: boolean; width?: number };
let { url, alt, lazyLoad, width }: Props = $props();
</script>
<img
class="rounded-circle img-fluid"
src={url || DEFAULT_AVATAR}
{alt}
2024-11-24 17:36:02 +01:00
width={width || 200}
loading={lazyLoad ? "lazy" : "eager"}
/>