I would like to extract out to a variable and remove the double ternaries. How could i refactor this code?
{text?.value?.indexOf('{{countdown}}') > -1 ? (
text?.value?.replace('{{countdown}}', countdown)
) : text.url ? (
<a className='normal-case mx-1' href={text.url}>
{text?.value}
</a>
) : (
text?.value
)}