| 
									
										
										
										
											2025-06-07 13:31:36 +02:00
										 |  |  | <script lang="ts"> | 
					
						
							| 
									
										
										
										
											2025-06-07 14:37:50 +02:00
										 |  |  |   import { Popover } from "flowbite-svelte" | 
					
						
							| 
									
										
										
										
											2025-06-07 13:31:36 +02:00
										 |  |  |   import { fade } from "svelte/transition" | 
					
						
							|  |  |  |   import { OsmConnection } from "../../Logic/Osm/OsmConnection" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   let open = false | 
					
						
							|  |  |  |   export let state: { osmConnection: OsmConnection } | 
					
						
							|  |  |  |   let userdetails = state.osmConnection.userDetails | 
					
						
							| 
									
										
										
										
											2025-06-25 16:55:55 +02:00
										 |  |  |   let username = userdetails.mapD(ud => ud.name) | 
					
						
							|  |  |  |   username.addCallbackAndRunD((ud) => { | 
					
						
							| 
									
										
										
										
											2025-06-07 13:31:36 +02:00
										 |  |  |     if (ud) { | 
					
						
							|  |  |  |       open = true | 
					
						
							|  |  |  |       window.setTimeout(() => { | 
					
						
							| 
									
										
										
										
											2025-06-25 16:55:55 +02:00
										 |  |  |          open = false | 
					
						
							|  |  |  |       }, 3000) | 
					
						
							| 
									
										
										
										
											2025-06-07 13:31:36 +02:00
										 |  |  |     } | 
					
						
							|  |  |  |   }) | 
					
						
							|  |  |  | </script> | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-06-18 21:40:01 +02:00
										 |  |  | <Popover | 
					
						
							| 
									
										
										
										
											2025-06-25 16:55:55 +02:00
										 |  |  |   class="mt-4 hidden sm:block" | 
					
						
							| 
									
										
										
										
											2025-06-18 21:40:01 +02:00
										 |  |  |   defaultClass="py-2 px-3 w-fit " | 
					
						
							|  |  |  |   trigger="null" | 
					
						
							|  |  |  |   placement="bottom" | 
					
						
							|  |  |  |   transition={(e) => fade(e, { duration: 150 })} | 
					
						
							|  |  |  |   bind:open | 
					
						
							|  |  |  | > | 
					
						
							| 
									
										
										
										
											2025-06-25 16:55:55 +02:00
										 |  |  |   {#if $username !== undefined} | 
					
						
							| 
									
										
										
										
											2025-06-07 13:31:36 +02:00
										 |  |  |     <div style="width: max-content" class="flex items-center"> | 
					
						
							|  |  |  |       {#if $userdetails.img} | 
					
						
							| 
									
										
										
										
											2025-06-18 22:31:50 +02:00
										 |  |  |         <img src={$userdetails.img} alt="avatar" class="mr-4 h-8 w-8 rounded-full" /> | 
					
						
							| 
									
										
										
										
											2025-06-07 13:31:36 +02:00
										 |  |  |       {/if} | 
					
						
							|  |  |  |       <div> | 
					
						
							|  |  |  |         <div>Welcome back</div> | 
					
						
							|  |  |  |         <div class="normal-background" style="width: max-content"> | 
					
						
							| 
									
										
										
										
											2025-06-25 16:55:55 +02:00
										 |  |  |           <b>{$username}</b> | 
					
						
							| 
									
										
										
										
											2025-06-07 13:31:36 +02:00
										 |  |  |         </div> | 
					
						
							|  |  |  |       </div> | 
					
						
							|  |  |  |     </div> | 
					
						
							|  |  |  |   {/if} | 
					
						
							|  |  |  | </Popover> |