@shopgate/engage
Version:
Shopgate's ENGAGE library.
36 lines (35 loc) • 1.09 kB
JavaScript
import React from 'react';
import PropTypes from 'prop-types';
import { RippleButton, I18n } from '@shopgate/engage/components';
import { i18n } from '@shopgate/engage/core';
import { wrapper, heading, name, button } from "./GlobalLocationSwitcherDefault.style";
/**
* @returns {JSX}
*/
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
const GlobalLocationSwitcherDefault = ({
locationName,
handleChange,
editable
}) => /*#__PURE__*/_jsxs("div", {
className: wrapper,
children: [/*#__PURE__*/_jsx("div", {
className: heading,
children: i18n.text('locations.your_current_location.heading')
}), /*#__PURE__*/_jsxs("div", {
className: name,
children: [/*#__PURE__*/_jsx("span", {
children: locationName
}), /*#__PURE__*/_jsx(RippleButton, {
onClick: handleChange,
type: "secondary",
className: button,
disabled: !editable,
flat: true,
children: /*#__PURE__*/_jsx(I18n.Text, {
string: "locations.your_current_location.change"
})
})]
})]
});
export default GlobalLocationSwitcherDefault;