-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add missing file that for some reaso wasn't in the previous commit
- Loading branch information
1 parent
f742bbf
commit e5ab59a
Showing
1 changed file
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import React from 'react' | ||
import { Box, Grid, Typography } from '@mui/material' | ||
import Markdown from '../Common/Markdown' | ||
|
||
export interface RiskElementProps { | ||
// eslint-disable-next-line react/require-default-props | ||
infoText?: string | ||
resultText: string | ||
risk: number | ||
} | ||
|
||
const RiskElement = ({ infoText, resultText, risk }: RiskElementProps) => { | ||
const colors: any = { | ||
1: '#2ecc71', | ||
2: '#f1c40f', | ||
3: '#e74c3c', | ||
} | ||
return ( | ||
<Box sx={{ paddingBottom: '10px', paddingLeft: '20px' }}> | ||
<Grid | ||
container | ||
spacing={2} | ||
direction="row" | ||
alignItems="baseline" | ||
justifyContent="space-between" | ||
> | ||
<Grid item> | ||
<Box> | ||
<Typography variant="body1">{resultText}</Typography> | ||
</Box> | ||
</Grid> | ||
<Grid item> | ||
<Box | ||
sx={{ | ||
display: 'flex', | ||
justifyContent: 'center', | ||
alignItems: 'center', | ||
minHeight: '50px', | ||
backgroundColor: colors[risk], | ||
width: '40px', | ||
borderRadius: '25%', | ||
}} | ||
> | ||
{risk} | ||
</Box> | ||
</Grid> | ||
</Grid> | ||
{infoText && ( | ||
<Box sx={{ width: '90%' }}> | ||
<Markdown>{infoText}</Markdown> | ||
</Box> | ||
)} | ||
</Box> | ||
) | ||
} | ||
|
||
export default RiskElement |