SyntaxError: Unexpected token 'if'

Hi
Could someone tell me what is wrong with this if statement please, I am getting an error “SyntaxError: Unexpected token ‘if’” I have placed this in Text Label, under Style Text Color;

{{
if ( TblClients.selectedRow.status == “Active”){ “#22c55e”; }
else if ( TblClients.selectedRow.status == “Pending”){ “#eab308”; }
else if ( TblClients.selectedRow.status == “Suspended”){ " #ef4444"; }
else { " #aaaaaa";}
}}

Thanks in advance

{ “#22c55e”; } is the problem; IF statements do not return anything directly. For this I’d suggest you use -

{{
(function () {
if ( TblClients.selectedRow.status == “Active”){ return “#22c55e”; }
else if ( TblClients.selectedRow.status == “Pending”){ return “#eab308”; }
else if ( TblClients.selectedRow.status == “Suspended”){ return " #ef4444"; }
else { return " #aaaaaa";}
})()
}}

Okay, New to JS. Use of return. I keep in mind.
Thanks Pranav