//
//  SLHomeMsgTableViewCell.m
//  SLAiELTS
//
//  Created by Gusont on 2023/5/16.
//

#import "SLHomeMsgTableViewCell.h"

@implementation SLHomeMsgTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    self.selectionStyle = UITableViewCellSelectionStyleDefault;
    self.headBadgeView.badgeCenterOffset = CGPointMake(-6, 6);
    self.headBadgeView.badgeMaximumBadgeNumber = 99;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}


- (void)confignCellWithModel:(SLChatListModel *)chatMode {
  NSString *userImg = [NSString stringWithFormat:@"%@%@",[SLHttpCenter SharedInstance].serverUrl, chatMode.dataHead];
    [self.headImageView sd_setImageWithURL:[NSURL URLWithString:userImg] placeholderImage:ImageName(@"icon_ellipse")];
    self.nameLabel.text = chatMode.dataName;// "[Voice Message]"
    self.msgLabel.text = chatMode.messageType ? @"[Voice Message]" : [NSString replaceHasPrefix:@"\n" str:chatMode.message];
    self.timeLabel.text = chatMode.sendDate;
    [self.headBadgeView showBadgeWithStyle:WBadgeStyleNumber value:chatMode.unReadCount animationType:WBadgeAnimTypeNone];
}

@end
