//
//  UserListChatCell.swift
//  WoWonder
//
//  Created by UnikaApp on 12/10/22.
//  Copyright © 2022 ScriptSun. All rights reserved.
//

import UIKit
import SkeletonView

class UserListChatCell: UITableViewCell {

    @IBOutlet weak var pinMessageWidth: NSLayoutConstraint!
    @IBOutlet weak var pinMessage: UIImageView!
    @IBOutlet weak var onlineImageView: UIImageView!
    @IBOutlet weak var countLabel: UILabel!
    @IBOutlet weak var countView: UIView!
    @IBOutlet weak var timeLabel: UILabel!
    @IBOutlet weak var lastMessageLabel: UILabel!
    @IBOutlet weak var userNameLabel: UILabel!
    @IBOutlet weak var userImageView: UIImageView!
    @IBOutlet weak var cellView: UIView!
    @IBOutlet weak var lastSeenImage: UIImageView!
    @IBOutlet weak var lastMessageIcon: UIImageView!
    @IBOutlet weak var statusView: UIView!
    @IBOutlet weak var muteImageView: UIImageView!
    @IBOutlet var sideView: UIView!
    
    override func awakeFromNib() {
        super.awakeFromNib()
        
        self.lastMessageIcon.image = UIImage(named: "ic_last_phone")
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
    func showAnimation() {
        [timeLabel, lastMessageLabel, userNameLabel, sideView].forEach { $0?.showAnimatedSkeleton() }
        userImageView.showAnimatedSkeleton()
        countView.showAnimatedSkeleton()
        pinMessage.showAnimatedSkeleton()
        lastSeenImage.showAnimatedSkeleton()
       // lastMessageIcone.showAnimatedSkeleton()
        statusView.showAnimatedSkeleton()
        muteImageView.showAnimatedSkeleton()
        sideView.showAnimatedSkeleton()
    }
    
    func hideAnimation() {
        [timeLabel, lastMessageLabel, userNameLabel ,sideView].forEach { $0?.hideSkeleton() }
        userImageView.hideSkeleton()
        countView.hideSkeleton()
        pinMessage.hideSkeleton()
        lastSeenImage.hideSkeleton()
        //lastMessageIcone.hideSkeleton()
        statusView.hideSkeleton()
        muteImageView.hideSkeleton()
        sideView.hideSkeleton()
    }
    
}
