//
//  WebSeriesCell.swift
//  WOKA
//
//  Created by MacBook Pro on 18/06/24.
//

import UIKit

class WebSeriesCell: UICollectionViewCell {

    @IBOutlet weak var cellImage: UIImageView!
    @IBOutlet weak var cellTitle: UILabel!
    @IBOutlet weak var episodeSeason: UILabel!
    @IBOutlet weak var outerStack: UIStackView!
    
    override func awakeFromNib() {
        super.awakeFromNib()
        
        // Initialization code
    }
    
    override func layoutSubviews() {
        super.layoutSubviews()
        outerStack.roundCorner(radius: 10)
        cellImage.addBorderView(width: 0.5, color: .white)
    }
    
    func setData(data : ContinueWatchingDM.ResultData){
        self.cellTitle.text = data.episodeTitle
        let seasonNumer = "S" + (data.seasonNumber ?? "0")
        let episodeNumer = "E" + (data.episodeNumber?.toString() ?? "0")
        self.episodeSeason.text = seasonNumer + "-" + episodeNumer
     
        if let url = data.thumbnailPath{
            cellImage.imageURL(url , color: .black)
        }
    }

}
