import { create } from 'zustand'

interface AddedToCartProduct {
  productId: number
  product: any
}

interface CartStore {
  addedToCartProduct: AddedToCartProduct | null
  setAddedToCartProduct: (product: AddedToCartProduct | null) => void
  clearAddedToCartProduct: () => void
}

export const useCartStore = create<CartStore>((set) => ({
  addedToCartProduct: null,
  setAddedToCartProduct: (product) => set({ addedToCartProduct: product }),
  clearAddedToCartProduct: () => set({ addedToCartProduct: null }),
}))
