package com.remax.visualnovel.entity.imbean.raw

import com.remax.visualnovel.R
import com.remax.visualnovel.app.base.app.CommonApplicationProxy
import com.remax.visualnovel.widget.imagepicker.utils.PDateUtil

/**
 * Created by HJW on 2025/8/21
 */

data class CustomCallData(
    val type: String,
    val callType: String,
    // 通话总时长
    val duration: Long,
) {
    companion object {
        const val CALL_CANCEL = "CALL_CANCEL"
        const val CALL_END = "CALL_END"
    }

    val callTxt: String?
        get() = when (callType) {
            CALL_CANCEL -> {
                CommonApplicationProxy.application.getString(R.string.call_canceled)
            }

            CALL_END -> {
                "${CommonApplicationProxy.application.getString(R.string.call_duration)} ${
                    PDateUtil.formatTime(
                        CommonApplicationProxy.application,
                        duration
                    )
                }"
            }

            else -> {
                null
            }
        }
}