Better way to handle this (if without else)

working with kotlin react (which I LOVE!!!)

when handling css i find that i write the following code

div("body ${if(state.pageStatus == EmailVerifyStatus.SUCCESS) "" else ""}"){

Is there a way to do this better, i basically want to eliminate : else “”

Use a map from status to style:

enum class EmailVerifyStatus {
    FAILURE,
    SUCCESS
}

class State(val pageStatus: EmailVerifyStatus)

val statusStyles = mapOf(EmailVerifyStatus.SUCCESS to "success style")

fun EmailVerifyStatus.toStyle() = statusStyles[this] ?: "default style"

fun main(args: Array<String>) {
    var state = State(EmailVerifyStatus.FAILURE)
    println("body ${state.pageStatus.toStyle()}")
    state = State(EmailVerifyStatus.SUCCESS)
    println("body ${state.pageStatus.toStyle()}")
}

Output:

body default style
body success style