mirror of
https://github.com/mrheffern/spokane-bitcoin-club.git
synced 2026-07-03 16:39:02 -07:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 42ae3ba990 |
@@ -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
|
||||||
Reference in New Issue
Block a user