Skip to content

Commit 0ac12bb

Browse files
committed
fix new sonar issue
Signed-off-by: David BRAQUART <[email protected]>
1 parent 0d7ddc3 commit 0ac12bb

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

src/pages/profiles/validity-cell-renderer.tsx

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,13 @@ import { Cancel, CheckCircle, RadioButtonUnchecked } from '@mui/icons-material';
1010
import { ICellRendererParams } from 'ag-grid-community';
1111

1212
export const ValidityCellRenderer = (props: ICellRendererParams) => {
13-
const renderIcon = (valid: boolean | undefined | null) => {
14-
if (valid == null) {
15-
return <RadioButtonUnchecked fontSize="small" />;
16-
} else if (valid) {
17-
return <CheckCircle fontSize="small" color="success" />;
18-
} else {
19-
return <Cancel fontSize="small" color="error" />;
20-
}
21-
};
22-
23-
return <Grid container>{renderIcon(props.value)}</Grid>;
13+
return (
14+
<Grid container>
15+
{props.value == null && <RadioButtonUnchecked fontSize="small" />}
16+
{props.value === true && <CheckCircle fontSize="small" color="success" />}
17+
{props.value === false && <Cancel fontSize="small" color="error" />}
18+
</Grid>
19+
);
2420
};
2521

2622
export default ValidityCellRenderer;

0 commit comments

Comments
 (0)