UNPKG

@etsoo/materialui

Version:

TypeScript Material-UI Implementation

17 lines (16 loc) 1.21 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.PercentLinearProgress = PercentLinearProgress; const jsx_runtime_1 = require("react/jsx-runtime"); const Box_1 = __importDefault(require("@mui/material/Box")); const LinearProgress_1 = __importDefault(require("@mui/material/LinearProgress")); const Typography_1 = __importDefault(require("@mui/material/Typography")); function PercentLinearProgress(props) { // Destruct const { textProps, valueUnit = "%", ...rest } = props; // Component return ((0, jsx_runtime_1.jsxs)(Box_1.default, { sx: { display: "flex", alignItems: "center", flexGrow: 2 }, children: [(0, jsx_runtime_1.jsx)(Box_1.default, { sx: { width: "100%", mr: 1 }, children: (0, jsx_runtime_1.jsx)(LinearProgress_1.default, { variant: "determinate", ...rest }) }), (0, jsx_runtime_1.jsx)(Box_1.default, { sx: { minWidth: 35 }, children: (0, jsx_runtime_1.jsx)(Typography_1.default, { variant: "caption", color: "text.secondary", ...textProps, children: `${Math.round(props.value)}${valueUnit}` }) })] })); }