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
|
|
|
|
|
|
|
|
|
|
userdetails.addCallbackAndRunD(ud => {
|
|
|
|
|
if (ud) {
|
|
|
|
|
open = true
|
|
|
|
|
window.setTimeout(() => {
|
|
|
|
|
open = false
|
|
|
|
|
}, 5000)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
2025-06-07 14:37:50 +02:00
|
|
|
<Popover class="mt-4 z-50" defaultClass="py-2 px-3 w-fit " trigger=null placement="bottom"
|
2025-06-07 13:31:36 +02:00
|
|
|
transition={e => fade(e, {duration: 150})} bind:open>
|
|
|
|
|
{#if $userdetails !== undefined}
|
|
|
|
|
<div style="width: max-content" class="flex items-center">
|
|
|
|
|
{#if $userdetails.img}
|
|
|
|
|
<img src={$userdetails.img } alt="profile picture" class="w-8 h-8 rounded-full mr-4" />
|
|
|
|
|
{/if}
|
|
|
|
|
<div>
|
|
|
|
|
<div>Welcome back</div>
|
|
|
|
|
<div class="normal-background" style="width: max-content">
|
|
|
|
|
<b>{$userdetails?.name}</b>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
{/if}
|
|
|
|
|
</Popover>
|
|
|
|
|
|