import { create } from "zustand";

export const useWishlist = create((set) => ({
  wishlistNotices: [],
  addNoticeToWishlist: (wishlistNotice) =>
    set((state) => ({
      wishlistNotices: [...state.wishlistNotices, wishlistNotice],
    })),
  removeNoticeFromWishlist: (noticeId) =>
    set((state) => ({
      wishlistNotices: state.wishlistNotices.filter(
        (item) => item.noticeId !== noticeId
      ),
    })),
}));
