import {
  FavouriteProductRes,
  ProductListResult,
} from '@/shared/config/api/product/type';
import { create } from 'zustand';

type State = {
  product: ProductListResult | FavouriteProductRes | null;
};

type Actions = {
  setProduct: (product: ProductListResult | FavouriteProductRes) => void;
};

export const useProductStore = create<State & Actions>((set) => ({
  product: null,
  setProduct: (product: ProductListResult | FavouriteProductRes) =>
    set(() => ({ product })),
}));
