//
//  ChatSettingBaseCell.swift
//  Visual_Novel_iOS
//
//  Created by mh on 2025/10/27.
//

import UIKit
import SnapKit

class ChatSettingBaseCell: UITableViewCell {
    
    var containerHeightConstraint: Constraint?
    
    lazy var containerView: UIView = {
        let view = UIView()
        view.backgroundColor = UIColor(hex: "#F6F6F6")
        view.cornerRadius = 15.0
        return view
    }()
    
    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        
        setupViews()
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    func setupViews() {
        
        contentView.addSubview(containerView)
        
        containerView.snp.makeConstraints { make in
            make.left.right.equalToSuperview().inset(20)
            make.top.bottom.equalToSuperview().inset(2.5)
            containerHeightConstraint = make.height.equalTo(45.0).constraint
        }
    }
    
    func updateContainerHeight(_ height: CGFloat) {
        containerHeightConstraint?.update(offset: height)
    }
}
