Handle single-line and multi-line email verification messages

Previously, multi-line messages were parsed for line breaks while single-line messages were not appropriately handled. This update checks if the value contains line breaks and processes it accordingly, ensuring both single-line and multi-line messages are displayed correctly.
This commit is contained in:
Teriuihi 2024-08-11 19:01:00 +02:00
parent 821e63953b
commit 25c6a15413

View File

@ -30,10 +30,12 @@ const ThankYou: FC = () => {
<div>
<p><strong>{key}</strong></p>
{
value
.split("\n")
.filter(str => str.trim() !== "")
.map((str, index) => <p style={{ wordWrap: 'break-word' }}>{str}</p>)
value.includes("\n") ?
value
.split("\n")
.filter(str => str.trim() !== "")
.map((str, index) => <p style={{ wordWrap: 'break-word' }} key={index}>{str}</p>)
: <p style={{ wordWrap: 'break-word' }}>{value}</p>
}
</div>
))}