added component

main
Max 2023-09-28 18:06:32 -07:00
parent 87f558cf6d
commit 42ae3ba990
1 changed files with 22 additions and 0 deletions

View File

@ -0,0 +1,22 @@
import { Typography } from '@mui/material'
import React from 'react'
const ProfitDisplay = (props) => {
console.log(props.profit);
if (Number.isNaN(props.profit) || props.profit <= 0) {
return (
<Typography align='center' variant='h4'>
Please enter an investment amount
</Typography>
)
} else {
const formattedAmount = props.profit.toLocaleString('en-US', { style: 'currency', currency: 'USD' });
return (
<Typography align='center' variant='h4'>
Your orignal investment would be {formattedAmount} today!
</Typography>
)
}
}
export default ProfitDisplay