diff --git a/striker-ui/components/Spinner.tsx b/striker-ui/components/Spinner.tsx index 3c90437b..7825916b 100644 --- a/striker-ui/components/Spinner.tsx +++ b/striker-ui/components/Spinner.tsx @@ -4,19 +4,33 @@ import { BoxProps as MUIBoxProps, CircularProgress as MUICircularProgress, circularProgressClasses as muiCircularProgressClasses, + CircularProgressProps as MUICircularProgressProps, } from '@mui/material'; import { TEXT } from '../lib/consts/DEFAULT_THEME'; -type SpinnerProps = MUIBoxProps; +type SpinnerOptionalProps = { + progressProps?: MUICircularProgressProps; +}; + +type SpinnerProps = MUIBoxProps & SpinnerOptionalProps; + +const SPINNER_DEFAULT_PROPS: Required = { + progressProps: {}, +}; const Spinner: FC = (spinnerProps): JSX.Element => { - const { sx, ...spinnerRestProps } = spinnerProps; + const { + sx, + progressProps = SPINNER_DEFAULT_PROPS.progressProps, + ...spinnerRestProps + } = spinnerProps; return ( = (spinnerProps): JSX.Element => { }, }} > - + ); }; +Spinner.defaultProps = SPINNER_DEFAULT_PROPS; + export default Spinner;