wip: UserSwitchButton

This commit is contained in:
2025-09-16 10:59:23 -04:00
parent 88f8b6919a
commit 50ea237667
2 changed files with 14 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
<script setup lang="ts">
defineProps<{ userId: number }>();
const { isUserSwitched, userSwitchBack, userSwitchTo } = useUserSwitching();
</script>
<template>
<UButton v-if="isUserSwitched" variant="outline" @click="userSwitchBack()">
Switch back
</UButton>
<UButton v-else @click="userSwitchTo(userId)">
Switch to
</UButton>
</template>

View File

@@ -11,5 +11,6 @@ const showLabels = breakpoints.greaterOrEqual("sm");
<UNavigationMenu :items="menuItems" variant="link" content-orientation="vertical" />
<LoginLogoutButton :show-labels="showLabels" />
<SignUpButton :show-labels="showLabels" />
<UserSwitchButton :user-id="2" />
</UContainer>
</template>