import { create } from "zustand";
import { ProjectTab } from "../types";
import { projectTabs } from "../consts/galleryPage";

interface StoreType {
  modal: React.ReactNode | null;
  selectedTab: ProjectTab;
  setSelectedTab: (tab: ProjectTab) =>void;
  setModal: (modal: React.ReactNode | null) => void;
}

const useStore = create<StoreType>((set) => ({
  modal: null,
  selectedTab: projectTabs[0],
  setSelectedTab: (tab) => set(() => ({ selectedTab: tab })),
  setModal: (modal) => set(() => ({ modal: modal })),
}));

export default useStore;