//
//  BlogsCell.swift
//  WOKA
//
//  Created by MacBook Pro on 10/06/24.
//

import UIKit

class BlogsCell: UICollectionViewCell {

    @IBOutlet weak var blogImage: UIImageView!
    @IBOutlet weak var blogTitle: UILabel!
    @IBOutlet weak var outerView: UIView!
    
    override func awakeFromNib() {
        super.awakeFromNib()
        outerView.roundCorner(radius: 10)
        // Initialization code
    }

    func setData(data : BlogDM.Blog){
        if let url = data.thumbnailPath{
            self.blogImage.imageURL(data.thumbnailPath!)
        }else{
            self.blogImage.image = UIImage(named: "Placeholder")
        }
        self.blogTitle.text = data.title
    }
}
