File size: 1,288 Bytes
55bd140
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<script lang="ts">
	import { getContext, onMount } from 'svelte';

	const i18n = getContext('i18n');
	import { WEBUI_BASE_URL } from '$lib/constants';

	export let user = null;
</script>

{#if user}
	<div class=" flex gap-3.5 w-full py-3 px-3 items-center">
		<div class=" items-center flex shrink-0">
			<img
				crossorigin="anonymous"
				src={user?.profile_image_url ?? `${WEBUI_BASE_URL}/static/favicon.png`}
				class=" size-12 object-cover rounded-xl"
				alt="profile"
			/>
		</div>

		<div class=" flex flex-col w-full flex-1">
			<div class="mb-0.5 font-medium line-clamp-1 pr-2">
				{user.name}
			</div>

			<div class=" flex items-center gap-2">
				{#if user?.active}
					<div>
						<span class="relative flex size-2">
							<span
								class="animate-ping absolute inline-flex h-full w-full rounded-full bg-green-400 opacity-75"
							/>
							<span class="relative inline-flex rounded-full size-2 bg-green-500" />
						</span>
					</div>

					<span class="text-xs"> {$i18n.t('Active')} </span>
				{:else}
					<div>
						<span class="relative flex size-2">
							<span class="relative inline-flex rounded-full size-2 bg-gray-500" />
						</span>
					</div>

					<span class="text-xs"> {$i18n.t('Away')} </span>
				{/if}
			</div>
		</div>
	</div>
{/if}