2023-12-30 07:03:48 +00:00
|
|
|
<script lang="ts">
|
2024-05-16 20:29:33 +00:00
|
|
|
import { settings } from '$lib/stores';
|
2024-05-17 17:56:16 +00:00
|
|
|
import { WEBUI_BASE_URL } from '$lib/constants';
|
2024-05-18 10:58:53 +00:00
|
|
|
|
2023-12-30 07:03:48 +00:00
|
|
|
export let src = '/user.png';
|
|
|
|
</script>
|
|
|
|
|
2024-05-16 22:22:46 +00:00
|
|
|
<div class={$settings?.chatDirection === 'LTR' ? "mr-3" : "ml-3"}>
|
2024-05-17 03:49:28 +00:00
|
|
|
<img
|
|
|
|
crossorigin="anonymous"
|
2024-05-17 17:56:16 +00:00
|
|
|
src={src.startsWith(WEBUI_BASE_URL) ||
|
|
|
|
src.startsWith('https://www.gravatar.com/avatar/') ||
|
|
|
|
src.startsWith('data:')
|
|
|
|
? src
|
|
|
|
: `/user.png`}
|
2024-05-17 03:49:28 +00:00
|
|
|
class=" w-8 object-cover rounded-full"
|
|
|
|
alt="profile"
|
|
|
|
draggable="false"
|
|
|
|
/>
|
2023-12-30 07:03:48 +00:00
|
|
|
</div>
|