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

23 lines
401 B
Svelte
Raw Normal View History

<script lang="ts">
import { DEFAULT_AVATAR } from "$lib";
2024-11-24 22:19:53 +01:00
type Props = { url: string | null; alt: string; lazyLoad?: boolean };
let { url, alt, lazyLoad }: Props = $props();
</script>
<img
class="rounded-circle img-fluid"
src={url || DEFAULT_AVATAR}
{alt}
2024-11-24 22:19:53 +01:00
width={200}
loading={lazyLoad ? "lazy" : "eager"}
/>
2024-11-24 22:19:53 +01:00
<style>
img {
object-fit: cover;
height: 200px;
width: 200px;
}
</style>