import { create } from "zustand";
import { devtools } from "zustand/middleware";

interface CartStore {
    notEnoughMoneyAmount: number;
}

export const useCartStore = create<CartStore>()(
    devtools(
        (get, set) => ({
            notEnoughMoneyAmount: 0,
        }),
        {
            name: "Cart",
            enabled: process.env.NODE_ENV === "development",
            trace: true,
            actionsBlacklist: "rejected",
        }
    )
);

export const setNotEnoughMoneyAmount = (amount: number) => useCartStore.setState({ notEnoughMoneyAmount: amount });
