@shopgate/engage
Version:
Shopgate's ENGAGE library.
3 lines • 819 B
JavaScript
import React,{useMemo}from'react';import PropTypes from'prop-types';import{css}from'glamor';import{Availability}from'@shopgate/engage/components';import{i18n}from'@shopgate/engage/core';import{AVAILABILITY_STATE_ALERT}from'@shopgate/engage/product';import{ROPIS,BOPIS}from"../../constants";export var container=css({fontSize:'0.625rem'}).toString();/**
* @returns {JSX}
*/export function FulfillmentSelectorLocationMethodNotAvailable(_ref){var method=_ref.method;var label=useMemo(function(){if(method===ROPIS){return i18n.text('locations.fulfillment.error.ropis');}if(method===BOPIS){return i18n.text('locations.fulfillment.error.bopis');}return null;},[method]);if(!label){return null;}return React.createElement(Availability,{className:container,showWhenAvailable:true,text:label,state:AVAILABILITY_STATE_ALERT});}