//
//  TSAIPhotoChildVM.swift
//  AIRingtone
//
//  Created by 100Years on 2025/3/5.
//

class TSAIPhotoChildVM {
    
    var style:TSGennerateType
    init(style: TSGennerateType) {
        self.style = style
        setRecentData()
        colDataArray.append(contentSecitonModel)
    }
    
    var colDataArray:[TSComponent] = [TSComponent]()
    
    lazy var contentSecitonModel: TSColVVMSectionModel = {
        let contentSeciton = TSColVVMSectionModel()
        contentSeciton.style = colStyle
        return contentSeciton
    }()
    
    
    func setRecentData() {
        contentSecitonModel.items.removeAll()
        var array = [TSColVVMItemModel]()
        dataList.forEach { model in
            let itemModel = TSColVVMItemModel()
            itemModel.dataModel = model
            itemModel.style = colStyle
            array.append(itemModel)
        }
        contentSecitonModel.items = array
    }
    
    var dataList:[TSActionInfoModel]{
        if style == .photo {
            return TSPhotoHistory.listModelArray
        }else{
            return TSPosterHistory.listModelArray
        }
        
    }
    
    var colStyle:TSColVVMStyple{
        if style == .photo {
            return .photoHistory
        }else{
            return .posterHistory
        }
    }
    
}
