//
//  EmailFilterFAVORITECell.swift
//  PhoneManager
//
//  Created by edy on 2025/5/12.
//

import UIKit

class EmailFilterFAVORITECell: UITableViewCell {

    static let id = "EmailFilterFAVORITECell"
    
    @IBOutlet weak var titleL: UILabel!
    
    @IBOutlet weak var LineW: UIView!
    var callblock:((Bool)->Void) = { select in}
    
    @IBOutlet weak var emSwtich: UISwitch!
    
    var top:Bool = false
    var bot:Bool = false
    
    func reload() -> Void {
        DispatchQueue.main.async {
            self.LineW.isHidden = false
            if self.top && self.bot {
                self.cornerCut(radius: 12, corner: [.allCorners])
            }else if self.top {
                self.cornerCut(radius: 12, corner: [.topLeft,.topRight])
            }else if self.bot {
                self.LineW.isHidden = true
                self.cornerCut(radius: 12, corner: [.bottomLeft,.bottomRight])
            }else{
                self.cornerCut(radius: 0, corner: [.allCorners])
            }
        }
    }
    
    @IBAction func selectActions(_ sender: UISwitch) {
//        sender.isOn = !sender.isOn
        self.vibrate()
        callblock(sender.isOn)
    }
    
    
}
