elk/components/user/UserPicker.vue
三咲智子 313cafa23c
feat: wip
2023-01-04 23:41:32 +08:00

29 lines
885 B
Vue

<script setup lang="ts">
const all = useUsers()
const masto = useMasto()
</script>
<template>
<div flex justify-start items-end px-2 gap-5>
<div flex="~ wrap-reverse" gap-5>
<template v-for="user of all" :key="user.id">
<button
flex rounded
cursor-pointer
aria-label="Switch user"
:class="user.account?.id === currentUser?.account?.id ? '' : 'op25 grayscale'"
hover="filter-none op100"
@click="switchUser(user, masto)"
>
<AccountAvatar v-if="!user.guest" w-13 h-13 :account="user.account" />
<div v-else bg="gray/40" rounded-full w-13 h-13 flex shrink-0 items-center justify-center text-5>
G
</div>
</button>
</template>
</div>
<div flex items-center justify-center w-13 h-13>
<UserDropdown />
</div>
</div>
</template>