diff --git a/components/ProfitDisplay.jsx b/components/ProfitDisplay.jsx new file mode 100644 index 0000000..564ae81 --- /dev/null +++ b/components/ProfitDisplay.jsx @@ -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 ( + + Please enter an investment amount + + ) + } else { + const formattedAmount = props.profit.toLocaleString('en-US', { style: 'currency', currency: 'USD' }); + return ( + + Your orignal investment would be {formattedAmount} today! + + ) + } +} + +export default ProfitDisplay \ No newline at end of file