//
//  SpeakEleProfileCollectCourseCell.swift
//  SpeakEasyLearnEnglish
//
//  Created by edy on 2025/7/25.
//

import UIKit

class SpeakEleProfileCollectCourseCell: UITableViewCell {

    static let id = "SpeakEleProfileCollectCourseCell"
    
    // MARK: - ib
    @IBOutlet weak var SpeakCollectIcon: UIImageView!
    @IBOutlet weak var SpeakCollectLeason: UILabel!
    @IBOutlet weak var SpeakCollectWordL: UIButton!
    @IBOutlet weak var SpeakCollectGramer: UIButton!
    @IBOutlet weak var SpeakCollectLineV: UIView!
    
    var isTop = false
    var isBot = false
    
    override func awakeFromNib() {
        super.awakeFromNib()
        self.backgroundColor = .white
        self.selectionStyle = .none
        self.clipsToBounds = true
    }
    
    override func layoutSubviews() {
        super.layoutSubviews()
        self.layoutIfNeeded()
        SpeakCollectLineV.isHidden = false
        if isBot {
            SpeakCollectLineV.isHidden = true
            self.cornerRect(radius: 16, [.bottomLeft,.bottomRight])
        }else if isTop {
            self.cornerRect(radius: 16, [.topLeft,.topRight])
        }else{
            self.cornerRect(radius: 0, [.allCorners])
        }
    }

}
