UNPKG

@etsoo/materialui

Version:

TypeScript Material-UI Implementation

23 lines (22 loc) 878 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.MoneyText = MoneyText; const jsx_runtime_1 = require("react/jsx-runtime"); const shared_1 = require("@etsoo/shared"); const Typography_1 = __importDefault(require("@mui/material/Typography")); /** * Money text * @param props Props * @returns Component */ function MoneyText(props) { // Destruct const { currency, isInteger = false, locale, options = {}, value, ...rest } = props; // Layout return ((0, jsx_runtime_1.jsx)(Typography_1.default, { component: "span", fontSize: "inherit", ...rest, children: value == null ? "" : shared_1.NumberUtils.formatMoney(value, currency, locale, isInteger, options) })); }