@shopgate/engage
Version:
Shopgate's ENGAGE library.
5 lines • 810 B
JavaScript
import React,{memo}from'react';import PropTypes from'prop-types';import{css}from'glamor';import{useWidgetStyles}from"../../../core";import SwatchContent from"./SwatchContent";export var WIDGET_ID='@shopgate/engage/product/Swatch';/**
* The swatch component.
* @param {Object} props The component props.
* @returns {JSX}
*/var Swatch=function Swatch(_ref){var swatch=_ref.swatch;if(!swatch){return null;}var styles=useWidgetStyles(WIDGET_ID);var classNames={swatch:styles&&styles.swatch?css(styles.swatch).toString():null,item:styles&&styles.item?css(styles.item).toString():null,itemSelected:styles&&styles.itemSelected?css(styles.itemSelected).toString():null};return React.createElement(SwatchContent,{swatch:swatch,classNames:classNames});};Swatch.defaultProps={swatch:null};export default memo(Swatch);