feat: implement propTypes for FlowSubstep and FlowSubstepTitle

This commit is contained in:
Rıdvan Akca
2024-05-15 13:56:57 +02:00
parent 9548c93b4c
commit b06c744392
4 changed files with 49 additions and 0 deletions

View File

@@ -1,15 +1,20 @@
import PropTypes from 'prop-types';
import * as React from 'react';
import ExpandLessIcon from '@mui/icons-material/ExpandLess';
import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
import ErrorIcon from '@mui/icons-material/Error';
import CheckCircleIcon from '@mui/icons-material/CheckCircle';
import { ListItemButton, Typography } from './style';
const validIcon = <CheckCircleIcon color="success" />;
const errorIcon = <ErrorIcon color="error" />;
function FlowSubstepTitle(props) {
const { expanded = false, onClick = () => null, valid = null, title } = props;
const hasValidation = valid !== null;
const validationStatusIcon = valid ? validIcon : errorIcon;
return (
<ListItemButton onClick={onClick} selected={expanded} divider>
<Typography variant="body2">
@@ -21,4 +26,12 @@ function FlowSubstepTitle(props) {
</ListItemButton>
);
}
FlowSubstepTitle.propTypes = {
expanded: PropTypes.bool,
onClick: PropTypes.func.isRequired,
valid: PropTypes.bool,
title: PropTypes.string.isRequired,
};
export default FlowSubstepTitle;