open-webui/src/lib/components/chat/Messages/ProfileImage.svelte

21 lines
490 B
Svelte
Raw Normal View History

2023-12-30 07:03:48 +00:00
<script lang="ts">
import { settings } from '$lib/stores';
2024-05-17 17:56:16 +00:00
import { WEBUI_BASE_URL } from '$lib/constants';
2024-05-18 22:02:47 +00:00
2023-12-30 07:03:48 +00:00
export let src = '/user.png';
</script>
2024-05-18 22:02:47 +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>