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.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. import NavigateNextIcon from '@mui/icons-material/NavigateNext';
  2. import { Breadcrumbs, Divider, Grid, Typography } from '@mui/material';
  3. import PropType from 'prop-types';
  4. const StepTitle = ({ title, breadcrumbsArray }) => {
  5. return (
  6. <>
  7. <Grid item xs={12}>
  8. <Typography
  9. variant="h4"
  10. sx={{
  11. ml: { xs: 2, md: 12 },
  12. mt: 12,
  13. height: '100%',
  14. color: 'primary.main',
  15. }}
  16. >
  17. {title}
  18. </Typography>
  19. </Grid>
  20. <Grid item xs={12}>
  21. <Divider
  22. sx={{
  23. backgroundColor: 'primary.main',
  24. ml: { xs: 2, md: 12 },
  25. mr: { xs: 2, md: 12 },
  26. }}
  27. />
  28. </Grid>
  29. <Grid item xs={12} sx={{ mt: 4 }}>
  30. <Breadcrumbs
  31. aria-label="breadcrumb"
  32. separator={<NavigateNextIcon fontSize="small" />}
  33. sx={{ ml: { xs: 2, md: 12 }, fontSize: 20 }}
  34. >
  35. {breadcrumbsArray &&
  36. breadcrumbsArray.map((entry, index) => {
  37. return (
  38. <Typography
  39. sx={{ fontSize: { xs: '16px', md: '22px' } }}
  40. key={index}
  41. color={
  42. index === breadcrumbsArray.length - 1 ? 'red' : 'black'
  43. }
  44. >
  45. {entry}
  46. </Typography>
  47. );
  48. })}
  49. </Breadcrumbs>
  50. </Grid>
  51. </>
  52. );
  53. };
  54. StepTitle.propTypes = {
  55. title: PropType.string,
  56. breadcrumbsArray: PropType.arrayOf(PropType.string),
  57. };
  58. export default StepTitle;