UNPKG

@shopgate/engage

Version:
6 lines 957 B
import React from'react';import PropTypes from'prop-types';import{I18n,PhoneIcon}from'@shopgate/engage/components';import{i18n}from'@shopgate/engage/core';import{StoreDetailsLine}from"./StoreDetailsLine";import{detailsPrimary,detailsSecondary}from"./Store.style";/** * Renders the store's phone number. * @param {Object} props The component props. * @param {string} props.phone The store's phone number. * @returns {JSX.Element} */export function StorePhoneNumber(_ref){var phone=_ref.phone;if(!phone){return null;}return React.createElement("a",{href:"tel:".concat(phone),"aria-label":"".concat(i18n.text('locations.phone'),": ").concat(phone),tabIndex:0},React.createElement(StoreDetailsLine,{icon:PhoneIcon,linked:true},React.createElement("div",{className:detailsPrimary,"aria-hidden":true},phone),React.createElement(I18n.Text,{string:"locations.phone",className:detailsSecondary,"aria-hidden":true})));}StorePhoneNumber.defaultProps={phone:null};