@shopgate/engage
Version:
Shopgate's ENGAGE library.
33 lines (31 loc) • 976 B
JavaScript
import React from 'react';
import { PRODUCT_OPTIONS } from '@shopgate/engage/product/constants';
import { SurroundPortals } from '@shopgate/engage/components';
import { ProductContext } from "../context";
import Content from "./components/Content";
import Option from "./components/Option";
import TextOption from "./components/TextOption";
// Export for theme api
import { jsx as _jsx } from "react/jsx-runtime";
export { TextOption, Option as SelectOption };
/**
* The Product Options component.
* @returns {JSX}
*/
const Options = () => /*#__PURE__*/_jsx(ProductContext.Consumer, {
children: ({
productId,
variantId,
options
}) => /*#__PURE__*/_jsx(SurroundPortals, {
portalName: PRODUCT_OPTIONS,
portalProps: {
productId: variantId || productId
},
children: /*#__PURE__*/_jsx(Content /* props needed in connector */, {
productId: variantId || productId,
currentOptions: options
})
})
});
export default Options;