Last active
January 29, 2023 14:20
-
-
Save ms314006/2e14a5cde2bdca0eb9506dac60cef6a9 to your computer and use it in GitHub Desktop.
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
const TransactionInfo = (transaction) => { | |
const getTransactionInfo = () => { | |
if (transaction.status === 'SUCCESS') { | |
return { | |
statusString: '成功', | |
isNonRefundable: false, | |
}; | |
} | |
return { | |
statusString: '失敗', | |
isNonRefundable: true, | |
}; | |
}; | |
return ( | |
<div> | |
<label>交易狀態:</label> | |
<span>{ getTransactionInfo().statusString }</span> | |
<button disabled={getTransactionInfo().isNonRefundable}> | |
退款 | |
</button> | |
</div> | |
); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment