<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>
