'use client';

import { create } from 'zustand';

interface UIState {
  sidebarOpen: boolean;
  loading: boolean;
  notification: string | null;

  toggleSidebar: () => void;
  setLoading: (value: boolean) => void;
  setNotification: (msg: string | null) => void;
}

export const useUIStore = create<UIState>((set) => ({
  sidebarOpen: false,
  loading: false,
  notification: null,

  toggleSidebar: () => set((state) => ({ sidebarOpen: !state.sidebarOpen })),
  setLoading: (value) => set({ loading: value }),
  setNotification: (msg) => set({ notification: msg }),
}));
