mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-20 09:20:16 +00:00
Migrate SidePanel state to Zustand (#799)
Co-authored-by: hardiknai-techm <HN00734461@TechMahindra.com>
This commit is contained in:
14
src/hooks/useNotificationConsole.ts
Normal file
14
src/hooks/useNotificationConsole.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import create, { UseStore } from "zustand";
|
||||
|
||||
export interface NotificationConsoleState {
|
||||
isExpanded: boolean;
|
||||
expandConsole: () => void;
|
||||
// TODO Remove this method. Add a `closeConsole` method instead
|
||||
setIsExpanded: (isExpanded: boolean) => void;
|
||||
}
|
||||
|
||||
export const useNotificationConsole: UseStore<NotificationConsoleState> = create((set) => ({
|
||||
isExpanded: false,
|
||||
expandConsole: () => set((state) => ({ ...state, isExpanded: true })),
|
||||
setIsExpanded: (isExpanded) => set((state) => ({ ...state, isExpanded })),
|
||||
}));
|
||||
Reference in New Issue
Block a user