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
40 lines
1.0 KiB
JavaScript
40 lines
1.0 KiB
JavaScript
import * as React from 'react';
|
|
import Box from '@mui/material/Box';
|
|
import Stepper from '@mui/material/Stepper';
|
|
import Step from '@mui/material/Step';
|
|
import StepLabel from '@mui/material/StepLabel';
|
|
import Typography from '@mui/material/Typography';
|
|
|
|
const steps = ['Select campaign settings', 'Create an ad group', 'Create an ad'];
|
|
|
|
export default function HorizontalStepperWithError() {
|
|
const isStepFailed = (step) => {
|
|
return step === 1;
|
|
};
|
|
|
|
return (
|
|
<Box sx={{ width: '100%' }}>
|
|
<Stepper activeStep={1}>
|
|
{steps.map((label, index) => {
|
|
const labelProps = {};
|
|
if (isStepFailed(index)) {
|
|
labelProps.optional = (
|
|
<Typography variant="caption" color="error">
|
|
Alert message
|
|
</Typography>
|
|
);
|
|
|
|
labelProps.error = true;
|
|
}
|
|
|
|
return (
|
|
<Step key={label}>
|
|
<StepLabel {...labelProps}>{label}</StepLabel>
|
|
</Step>
|
|
);
|
|
})}
|
|
</Stepper>
|
|
</Box>
|
|
);
|
|
}
|