You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

StepTitle.jsx 1.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. import { Breadcrumbs, Divider, Grid, Typography } from '@mui/material';
  2. import PropType from 'prop-types';
  3. const StepTitle = ({ title, breadcrumbsArray }) => {
  4. return (
  5. <>
  6. <Grid item xs={12}>
  7. <Typography
  8. variant="h3"
  9. sx={{ pl: 12, mt: 12, height: '100%', color: 'primary.main' }}
  10. >
  11. {title}
  12. </Typography>
  13. </Grid>
  14. <Grid item xs={12}>
  15. <Divider sx={{ backgroundColor: 'primary.main', mx: 12 }} />
  16. </Grid>
  17. <Grid item xs={12} sx={{ mt: 4 }}>
  18. <Breadcrumbs
  19. aria-label="breadcrumb"
  20. separator="›"
  21. sx={{ pl: 12, fontSize: 20 }}
  22. >
  23. {breadcrumbsArray.map((entry, index) => {
  24. return (
  25. <Typography
  26. key={index}
  27. color={index === breadcrumbsArray.length - 1 ? 'red' : 'black'}
  28. >
  29. {entry}
  30. </Typography>
  31. );
  32. })}
  33. <Typography></Typography>
  34. </Breadcrumbs>
  35. </Grid>
  36. </>
  37. );
  38. };
  39. StepTitle.propTypes = {
  40. title: PropType.string,
  41. breadcrumbsArray: PropType.arrayOf(PropType.string),
  42. };
  43. export default StepTitle;