I want to improve the this code by adding if or switch case:
Original code:
{(errorMessage || invalidEmailError.length > 0) && (
<Message type="error" className="mt-l">
{`If an account exists` || invalidEmailError}
</Message>
)}
I want to change Message type="error" to Message type="success" so I tried this:
{invalidEmailError.length > 0 && (
<Message type="error" className="mt-l">
{invalidEmailError}
</Message>
)}
{errorMessage && (
<Message type="success" className="mt-l">
{`If an account exists `}
</Message>
)}
If it possible to use if or switch case here so I can improve the code?