"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const jsx_runtime_1 = require("react/jsx-runtime");
const LinearProgress_1 = tslib_1.__importDefault(require("@mui/material/LinearProgress"));
const material_1 = require("@mui/material");
const styles_1 = require("@mui/material/styles");
const classnames_1 = tslib_1.__importDefault(require("classnames"));
const PREFIX = 'SCProgressBar';
const classes = {
    root: `${PREFIX}-root`,
    bar: `${PREFIX}-bar`,
    progress: `${PREFIX}-progress`,
    message: `${PREFIX}-message`
};
const Root = (0, styles_1.styled)(material_1.Box, {
    name: PREFIX,
    slot: 'Root',
    overridesResolver: (props, styles) => styles.root
})(() => ({}));
function ProgressBar(props) {
    const { className, value, loadingMessage = null, hideBar = false } = props, rest = tslib_1.__rest(props, ["className", "value", "loadingMessage", "hideBar"]);
    return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className) }, { children: [(0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.message }, { children: loadingMessage })), !hideBar && (0, jsx_runtime_1.jsx)(LinearProgress_1.default, Object.assign({ variant: "determinate", color: "success", className: classes.bar, value: value }, rest)), (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.progress }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h4", color: "secondary" }, { children: `${Math.round(value)}%` })) }))] })));
}
exports.default = ProgressBar;
