19 lines
477 B
TypeScript
19 lines
477 B
TypeScript
import { create } from "zustand";
|
|
import type { ReactNode } from "react";
|
|
|
|
interface ModalState {
|
|
modal: ReactNode | null;
|
|
setModal: (modal: ReactNode | null) => void;
|
|
position: "center" | "right";
|
|
setPosition: (position: "center" | "right") => void;
|
|
}
|
|
|
|
const useModalStore = create<ModalState>()((set) => ({
|
|
modal: null,
|
|
position: "center",
|
|
setPosition: (position) => set({ position }),
|
|
setModal: (modal) => set({ modal }),
|
|
}));
|
|
|
|
export default useModalStore;
|