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

interface ProductStore {
  productName: string;
  setProductName: (name: string) => void;
  resetProductName: () => void;
}

export const useProductStore = create<ProductStore>()(
  devtools(
    persist(
      (set) => ({
        productName: "",
        setProductName: (name: string) => set({ productName: name }),
        resetProductName: () => set({ productName: "" }),
      }),
      {
        name: "product-storage",
      }
    )
  )
);
