Files
FEDEO/frontend/composables/useDashboard.ts
florianfederspiel 3f8ce5daf7
All checks were successful
Build and Push Docker Images / build-backend (push) Successful in 30s
Build and Push Docker Images / build-frontend (push) Successful in 1m8s
Tasks und Vertragstyp fix #17
2026-02-15 22:02:16 +01:00

35 lines
1.2 KiB
TypeScript

import { createSharedComposable } from '@vueuse/core'
const _useDashboard = () => {
const route = useRoute()
const router = useRouter()
const isHelpSlideoverOpen = ref(false)
const isNotificationsSlideoverOpen = ref(false)
defineShortcuts({
'g-h': () => router.push('/'),
'g-a': () => router.push('/tasks'),
'g-d': () => router.push('/files'),
'g-k': () => router.push('/standardEntity/customers'),
'g-l': () => router.push('/standardEntity/vendors'),
'g-s': () => router.push('/settings'),
'g-p': () => router.push('/standardEntity/projects'),
'g-v': () => router.push('/standardEntity/contracts'),
'g-o': () => router.push('/standardEntity/plants'),
'?': () => isHelpSlideoverOpen.value = !isHelpSlideoverOpen.value,
n: () => isNotificationsSlideoverOpen.value = !isNotificationsSlideoverOpen.value
})
watch(() => route.fullPath, () => {
isHelpSlideoverOpen.value = false
isNotificationsSlideoverOpen.value = false
})
return {
isHelpSlideoverOpen,
isNotificationsSlideoverOpen
}
}
export const useDashboard = createSharedComposable(_useDashboard)