WIP - UI drawer initial

This commit is contained in:
Francisco Gaona
2026-01-07 22:11:36 +01:00
parent b34da6956c
commit 8ad3fac1b0
4 changed files with 169 additions and 13 deletions

View File

@@ -22,12 +22,19 @@ import { useSoftphone } from '~/composables/useSoftphone'
const { logout } = useAuth()
const { api } = useApi()
const isDrawerOpen = useState<boolean>('bottomDrawerOpen', () => false)
const drawerTab = useState<string>('bottomDrawerTab', () => 'softphone')
const softphone = useSoftphone()
const handleLogout = async () => {
await logout()
}
const openSoftphoneDrawer = () => {
drawerTab.value = 'softphone'
isDrawerOpen.value = true
}
// Check if user is central admin (by checking if we're on a central subdomain)
// Use ref instead of computed to avoid hydration mismatch
const isCentralAdmin = ref(false)
@@ -336,10 +343,13 @@ const centralAdminMenuItems: Array<{
<SidebarFooter>
<SidebarMenu>
<SidebarMenuItem v-if="!isCentralAdmin">
<SidebarMenuButton @click="softphone.open" class="cursor-pointer hover:bg-accent">
<SidebarMenuButton @click="openSoftphoneDrawer" class="cursor-pointer hover:bg-accent">
<Phone class="h-4 w-4" />
<span>Softphone</span>
<span v-if="softphone.hasIncomingCall.value" class="ml-auto h-2 w-2 rounded-full bg-red-500 animate-pulse"></span>
<span
v-if="softphone.hasIncomingCall.value"
class="ml-auto h-2 w-2 rounded-full bg-red-500 animate-pulse"
/>
</SidebarMenuButton>
</SidebarMenuItem>
<SidebarMenuItem>