//
//  LNIMChatCallMessageCell.swift
//  Gami
//
//  Created by OneeChan on 2026/2/4.
//

import Foundation
import UIKit
import SnapKit
//

class LNIMChatCallMessageCell: LNIMChatBaseMessageCell {
    private let contextLabel = UILabel()
    
    override func update(_ data: LNIMMessageData, viewModel: LNIMChatViewModel) {
        super.update(data, viewModel: viewModel)
        
        guard let order: LNIMVoiceCallMessage = data.decodeCustomMessage() else { return }
        contextLabel.text = order.contentDesc
    }
    
    override func setupViews() {
        super.setupViews()
        
        let callIc = UIImageView()
        callIc.image = .icImChatCallOver
        container.addSubview(callIc)
        callIc.snp.makeConstraints { make in
            make.centerY.equalToSuperview()
            make.leading.equalToSuperview()
        }
        
        contextLabel.font = .body_l
        contextLabel.textColor = .text_5
        contextLabel.numberOfLines = 0
        container.addSubview(contextLabel)
        contextLabel.snp.makeConstraints { make in
            make.verticalEdges.equalToSuperview()
            make.trailing.equalToSuperview()
            make.leading.equalTo(callIc.snp.trailing).offset(12)
        }
    }
}


