ProfileImage.svelte 401 Bytes
Newer Older
1
<script lang="ts">
Timothy J. Baek's avatar
Timothy J. Baek committed
2
	import { WEBUI_BASE_URL } from '$lib/constants';
3
4
5
	export let src = '/user.png';
</script>

Timothy J. Baek's avatar
Timothy J. Baek committed
6
<div class=" mr-3">
Timothy J. Baek's avatar
Timothy J. Baek committed
7
8
	<img
		crossorigin="anonymous"
Timothy J. Baek's avatar
Timothy J. Baek committed
9
10
11
12
13
		src={src.startsWith(WEBUI_BASE_URL) ||
		src.startsWith('https://www.gravatar.com/avatar/') ||
		src.startsWith('data:')
			? src
			: `/user.png`}
Timothy J. Baek's avatar
Timothy J. Baek committed
14
15
16
17
		class=" w-8 object-cover rounded-full"
		alt="profile"
		draggable="false"
	/>
18
</div>