package com.doctate.watch.domain

/**
 * Text the UI should render for a oneliner state, or null when nothing
 * meaningful exists yet. Empty/Error collapse to null so the UI can render
 * a placeholder ("…") in both cases.
 */
fun OnelinerState?.displayText(): String? = when (this) {
    null -> null
    is OnelinerState.Ready -> text
    is OnelinerState.Manual -> text
    is OnelinerState.Empty -> null
    is OnelinerState.Error -> null
}

/** True when the oneliner is a doctor-authored override. Drives auto-update suppression. */
fun OnelinerState?.isManual(): Boolean = this is OnelinerState.Manual
