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

8
<div class={$settings?.chatDirection === 'LTR' ? "mr-3" : "ml-3"}>
Timothy J. Baek's avatar
Timothy J. Baek committed
9
10
	<img
		crossorigin="anonymous"
Timothy J. Baek's avatar
Timothy J. Baek committed
11
12
13
14
15
		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
16
17
18
19
		class=" w-8 object-cover rounded-full"
		alt="profile"
		draggable="false"
	/>
20
</div>