package ru.forbion.f7cloud.feature.talk

data class TalkParticipant(
    val actorId: String,
    val actorType: String,
    val displayName: String,
    val participantType: Int,
    val inCall: Int = 0,
    val status: String = "",
    val statusMessage: String? = null,
) {
    val isInCall: Boolean get() = inCall > 0
    val roleLabel: String get() = participantRoleLabel(participantType)
}

data class TalkUserCandidate(
    val userId: String,
    val displayName: String,
    val source: String = "users",
)

enum class CreateRoomMode {
    ONE_TO_ONE,
    GROUP,
}

fun participantRoleLabel(type: Int): String = when (type) {
    1 -> "Владелец"
    2 -> "Модератор"
    3 -> "Участник"
    else -> "Участник"
}

fun userStatusLabel(status: String): String = when (status) {
    "online" -> "В сети"
    "away" -> "Отошёл"
    "dnd" -> "Не беспокоить"
    "offline", "" -> "Не в сети"
    else -> status
}
