//
//  TSDiyKeyboardViewModel.swift
//  AIEmoji
//
//  Created by 100Years on 2025/1/21.
//

import ObjectMapper

class TSWallpaperViewModel : TSBaseViewModel{
    
    
    //####################################联动视图相关的####################################//
    let itemW = 71.0
    lazy var segmentedViewW:CGFloat = {
        return itemW * CGFloat(segmentedImageArray.count)
    }()
    
    lazy var segmentedImageArray: [String] = {
        var titleImageArray = [String]()
        for model in keyStickerModels {
            if let imageNamed = model.imageUrl {
                titleImageArray.append(imageNamed)
            }
        }
        return titleImageArray
    }()
    
    lazy var segmentedTitleArray: [String] = {
        var titles = [String]()
        for model in keyStickerModels {
            titles.append("")
        }
        return titles
    }()
    
    lazy var keyStickerModels: [DiyStickerCategory] = {
        var keyStickerModels = [DiyStickerCategory]()
        if let dataArray = Mapper<DiyStickerCategory>().mapArray(JSONfile: "sticker.json"){
            keyStickerModels = dataArray
        }
        return keyStickerModels
    }()
    
    //####################################diy视图相关的####################################//
    lazy var templateModels: [DiyPaperTemplateModel] = {
        var templateModels = [DiyPaperTemplateModel]()
        if let dataArray = Mapper<DiyPaperTemplateModel>().mapArray(JSONfile: "templates.json"){
            templateModels = dataArray
        }
        return templateModels
    }()
}
