//
//  SLMomentsNewsCell.m
//  SLAiELTS
//
//  Created by Gusont on 2023/5/30.
//

#import "SLMomentsNewsCell.h"

@implementation SLMomentsNewsCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

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

    // Configure the view for the selected state
}

- (void)confignNewsCell:(SLMomentsNewsModel *)model {
    self.nameLabel.text = model.userName;
    if (model.image.length) {
        NSString *momentImage = [NSString stringWithFormat:@"%@%@",[SLHttpCenter SharedInstance].serverUrl,[model.image componentsSeparatedByString:@","].firstObject];
        [self.momentImageView sd_setImageWithURL:[NSURL URLWithString:momentImage] placeholderImage:nil];
    }
    NSString *headUrl = [NSString stringWithFormat:@"%@%@",[SLHttpCenter SharedInstance].serverUrl,model.head];
    [self.headImageView sd_setImageWithURL:[NSURL URLWithString:headUrl] placeholderImage:ImageName(@"icon_ellipse")];
    self.timeLabel.text = model.interDate;
    self.plLabel.text = model.commentContent;
    if ([model.interType isEqualToString:@"0"]) {
        self.likeBgView.hidden = NO;
        self.plLabel.text = @" ";
        self.plLabel.hidden = YES;
    }else {
        self.likeBgView.hidden = YES;
        self.plLabel.hidden = NO;
    }
}

@end
