export default {
  getBundleList: state => state.bundleList || [],
  getBundleListPaginationMeta: state => {
    return { total: state.bundleListRecordTotal || 0, per_page: 20 }
  },
  getBundleDetails: state => state.bundleDetails,
  getBundleCountryId: state => state.bundleCountryId,
  getBundleProductFilter: state => state.bundleProductSearchFilter,
  getBundleCartDetails: state => state.bundleCartDetails,
  getProductUnitQuantity: (state, getter) => (productId, kittingId) => {
    let cart = getter.getBundleCartDetails.bundleItems || []
    let product = cart.find(item => item.product_id === productId && item.kitting_id === kittingId) || {}
    return product.product_quantity || 0
  },
}
