From e5ab59a4e54aeaad3d3838d27a312b592ac4878a Mon Sep 17 00:00:00 2001 From: erikao1998 Date: Fri, 24 Nov 2023 16:39:04 +0200 Subject: [PATCH] Add missing file that for some reaso wasn't in the previous commit --- .../components/ResultPage/RiskElement.tsx | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 src/client/components/ResultPage/RiskElement.tsx diff --git a/src/client/components/ResultPage/RiskElement.tsx b/src/client/components/ResultPage/RiskElement.tsx new file mode 100644 index 0000000..355a185 --- /dev/null +++ b/src/client/components/ResultPage/RiskElement.tsx @@ -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 ( + + + + + {resultText} + + + + + {risk} + + + + {infoText && ( + + {infoText} + + )} + + ) +} + +export default RiskElement