24 lines
531 B
TypeScript
24 lines
531 B
TypeScript
import { useLocalStorageRef } from '~/utils/useLocalStorageRef'
|
|
import type { Ref } from 'vue'
|
|
|
|
interface SidebarFeatures {
|
|
showWorkstations: boolean
|
|
showAiTools: boolean
|
|
showLeadsHub: boolean
|
|
}
|
|
|
|
const KEY = 'policy-ui-sidebar-features-v1'
|
|
|
|
let _shared: Ref<SidebarFeatures> | null = null
|
|
|
|
export function useSidebarFeatures() {
|
|
if (!_shared) {
|
|
_shared = useLocalStorageRef<SidebarFeatures>(KEY, () => ({
|
|
showWorkstations: false,
|
|
showAiTools: false,
|
|
showLeadsHub: true,
|
|
}))
|
|
}
|
|
return _shared
|
|
}
|