//
//  ItemCell.swift
//  FoodOrderApp
//
//  Created by Simge Çakır on 20.08.2021.
//

import UIKit

class ItemCell: UITableViewCell {

    let horizontalCard = HorizontalInfoCardView()
    let functionalButton = FunctionalButton()
    
    override func awakeFromNib() {
        super.awakeFromNib()
        addSubview(horizontalCard)
        addSubview(functionalButton)
    }
    
    override func layoutSubviews() {
        functionalButton.frame = CGRect(x: contentView.frame.maxX - 100, y: contentView.frame.midY - 15, width: 95, height: 35)
        horizontalCard.frame = CGRect(x: 0, y: 0, width: contentView.frame.width, height: contentView.frame.height)
    }
    
    func configure(cardModel: HorizontalInfoCardModel, butttonModel: FunctionalButtonModel){
        horizontalCard.configure(with: cardModel)
        functionalButton.configure(with: butttonModel)
    }

}
