useCollapsedState.ts 386 B

123456789101112131415
  1. // Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. import { type ComputedRef, inject, type InjectionKey } from 'vue'
  3. export const COLLAPSED_STATE_KEY = Symbol(
  4. 'collapsed-state-key',
  5. ) as InjectionKey<ComputedRef<boolean>>
  6. export const useCollapsedState = () => {
  7. const collapsedState = inject(COLLAPSED_STATE_KEY)
  8. return {
  9. collapsedState,
  10. }
  11. }