import React from 'react';
import { productsApi, ProductProvider } from '@sentecacommerce-theme/lib';
import { UpdateProductPrice } from '../UpdateProductPrice';
import { SizeSelector } from '../SizeSelector';
export var VariantsLoader = (_ref) => {
  var {
    slug,
    updatePrice,
    priceState,
    openSelectSizeModal,
    handleClose,
    variantId
  } = _ref;
  var {
    data,
    isLoading
  } = productsApi.useProduct(slug);
  if (!data || isLoading) return null;
  return /*#__PURE__*/React.createElement(ProductProvider, {
    product: data
  }, /*#__PURE__*/React.createElement(SizeSelector, {
    defaultVariantId: data.masterVariantId,
    openSelectSizeModal: openSelectSizeModal,
    handleClose: handleClose,
    variantId: variantId
  }), /*#__PURE__*/React.createElement(UpdateProductPrice, {
    priceState: priceState,
    updatePrice: updatePrice
  }));
};
//# sourceMappingURL=index.js.map