1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import React from 'react';
6 import Button, { ButtonProps } from '@mui/material/Button';
7 import { CircularProgress } from '@mui/material';
8 import withStyles from '@mui/styles/withStyles';
9 import { CircularProgressProps } from '@mui/material/CircularProgress';
11 interface ProgressButtonProps extends ButtonProps {
13 progressProps?: CircularProgressProps;
16 export const ProgressButton = ({ loading, progressProps, children, disabled, ...props }: ProgressButtonProps) =>
17 <Button {...props} disabled={disabled || loading}>
19 {loading && <Progress {...progressProps} size={getProgressSize(props.size)} />}
22 const Progress = withStyles({
28 const getProgressSize = (size?: 'small' | 'medium' | 'large') => {