// 1) Conditional rendering for function
let calc_mobileCtr = "calc_mobileCtr";
if (isSponsorCalculator) {
if (PropertyPrice >= 1500000) {
calc_mobileCtr = "calc_mobileCtr hsbc";
} else {
calc_mobileCtr = "calc_mobileCtr";
}
} else {
calc_mobileCtr = "calc_mobileCtr";
}
// 2) Conditional rendering for JSX
{isSponsorCalculator ? (
PropertyPrice >= 1500000 ? (
// show A, with function conditional rendering
{calc_mobileCtr}
) : (
// show B
)
) : (
// else, show B
)}