Some checks failed
No response / noResponse (push) Has been cancelled
CI / Continuous releases (push) Has been cancelled
CI / test-dev (macos-latest) (push) Has been cancelled
CI / test-dev (ubuntu-latest) (push) Has been cancelled
CI / test-dev (windows-latest) (push) Has been cancelled
Maintenance / main (push) Has been cancelled
Scorecards supply-chain security / Scorecards analysis (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
50 lines
1.3 KiB
TypeScript
50 lines
1.3 KiB
TypeScript
import * as React from 'react';
|
|
import { useTheme } from '@mui/material/styles';
|
|
import MobileStepper from '@mui/material/MobileStepper';
|
|
import Button from '@mui/material/Button';
|
|
import KeyboardArrowLeft from '@mui/icons-material/KeyboardArrowLeft';
|
|
import KeyboardArrowRight from '@mui/icons-material/KeyboardArrowRight';
|
|
|
|
export default function DotsMobileStepper() {
|
|
const theme = useTheme();
|
|
const [activeStep, setActiveStep] = React.useState(0);
|
|
|
|
const handleNext = () => {
|
|
setActiveStep((prevActiveStep) => prevActiveStep + 1);
|
|
};
|
|
|
|
const handleBack = () => {
|
|
setActiveStep((prevActiveStep) => prevActiveStep - 1);
|
|
};
|
|
|
|
return (
|
|
<MobileStepper
|
|
variant="dots"
|
|
steps={6}
|
|
position="static"
|
|
activeStep={activeStep}
|
|
sx={{ maxWidth: 400, flexGrow: 1 }}
|
|
nextButton={
|
|
<Button size="small" onClick={handleNext} disabled={activeStep === 5}>
|
|
Next
|
|
{theme.direction === 'rtl' ? (
|
|
<KeyboardArrowLeft />
|
|
) : (
|
|
<KeyboardArrowRight />
|
|
)}
|
|
</Button>
|
|
}
|
|
backButton={
|
|
<Button size="small" onClick={handleBack} disabled={activeStep === 0}>
|
|
{theme.direction === 'rtl' ? (
|
|
<KeyboardArrowRight />
|
|
) : (
|
|
<KeyboardArrowLeft />
|
|
)}
|
|
Back
|
|
</Button>
|
|
}
|
|
/>
|
|
);
|
|
}
|