diff --git a/src/renderer/store/app.store.ts b/src/renderer/store/app.store.ts index eeb71d49..0cd6e4cb 100644 --- a/src/renderer/store/app.store.ts +++ b/src/renderer/store/app.store.ts @@ -18,7 +18,15 @@ type TitlebarProps = { outOfView: boolean; }; +type CommandPaletteProps = { + close: () => void; + open: () => void; + opened: boolean; + toggle: () => void; +}; + export interface AppState { + commandPalette: CommandPaletteProps; isReorderingQueue: boolean; platform: Platform; sidebar: SidebarProps; @@ -52,6 +60,24 @@ export const useAppStore = create()( }); }, }, + commandPalette: { + close: () => { + set((state) => { + state.commandPalette.opened = false; + }); + }, + open: () => { + set((state) => { + state.commandPalette.opened = true; + }); + }, + opened: false, + toggle: () => { + set((state) => { + state.commandPalette.opened = !state.commandPalette.opened; + }); + }, + }, isReorderingQueue: false, platform: Platform.WINDOWS, sidebar: { @@ -88,3 +114,5 @@ export const useSidebarRightExpanded = () => useAppStore((state) => state.sideba export const useSetTitlebar = () => useAppStore((state) => state.actions.setTitleBar); export const useTitlebarStore = () => useAppStore((state) => state.titlebar); + +export const useCommandPalette = () => useAppStore((state) => state.commandPalette);