var __rest = (this && this.__rest) || function (s, e) {
    var t = {};
    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
        t[p] = s[p];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
                t[p[i]] = s[p[i]];
        }
    return t;
};
import React from 'react';
import { CircularProgress as MuiCircularProgress } from '@material-ui/core';
import { makeStyles } from '@material-ui/core/styles';
import clsx from 'clsx';
const useStyles = makeStyles(theme => ({
    circleColorPrimary: {
        color: theme.palette.primary.main,
    },
    circleColorSecondary: {
        color: theme.palette.secondary.main,
    },
    circleColorSuccess: {
        color: theme.palette.success.main,
    },
    circleColorError: {
        color: theme.palette.error.main,
    },
    circleColorWarning: {
        color: theme.palette.warning.main,
    },
    circleColorInfo: {
        color: theme.palette.info.main,
    },
    // Custom circle color class
    customColorCircle: props => ({
        backgroundColor: props.color,
    }),
}));
export const CircularProgress = props => {
    const { variant = 'indeterminate', value, color = 'primary' } = props, otherProps = __rest(props, ["variant", "value", "color"]);
    const isPredefinedColor = [
        'primary',
        'secondary',
        'success',
        'error',
        'warning',
        'info',
    ].includes(color);
    const classes = useStyles({ color });
    return (React.createElement(MuiCircularProgress, Object.assign({}, otherProps, { variant: variant, value: value, classes: {
            root: classes.root,
            circle: clsx({
                [classes.circleColorPrimary]: color === 'primary',
                [classes.circleColorSecondary]: color === 'secondary',
                [classes.circleColorSuccess]: color === 'success',
                [classes.circleColorError]: color === 'error',
                [classes.circleColorWarning]: color === 'warning',
                [classes.circleColorInfo]: color === 'info',
                [classes.customColorCircle]: !isPredefinedColor,
            }),
        } })));
};
//# sourceMappingURL=CircularProgress.js.map