@rsc-labs/medusa-store-analytics
Version:
Get analytics data about your store
29 lines (28 loc) • 1.11 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.IconComparison = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
/*
* Copyright 2024 RSC-Labs, https://rsoftcon.com/
*
* MIT License
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
const icons_1 = require("@medusajs/icons");
const IconComparison = ({ current, previous, switchArrow }) => {
if (current == previous) {
return (0, jsx_runtime_1.jsx)(icons_1.MinusMini, { color: "black" });
}
if (current > previous) {
return (0, jsx_runtime_1.jsx)(icons_1.ArrowUpMini, { color: switchArrow ? "red" : "green" });
}
if (current < previous) {
return (0, jsx_runtime_1.jsx)(icons_1.ArrowDownMini, { color: switchArrow ? "green" : "red" });
}
};
exports.IconComparison = IconComparison;