//
//  SettingsPresenter.swift
//  GPS Tracker
//
//  Created by Guntis on 2022.
//  Copyright (c) 2022 . All rights reserved.
//
//  This file was generated by the Clean Swift Xcode Templates so
//  you can apply clean architecture to your iOS and Mac projects,
//  see http://clean-swift.com
//

import UIKit

protocol SettingsPresentationLogic {
  	func presentSettingsListWithData(response: Settings.SettingsList.Response)
}

class SettingsPresenter: SettingsPresentationLogic {
  	weak var viewController: SettingsDisplayLogic?
	weak var router: SettingsRouter?

  	// MARK: SettingsPresentationLogic

  	func presentSettingsListWithData(response: Settings.SettingsList.Response) {

		let settingsItem1 = Settings.SettingsList.ViewModel.DisplayedSettingsCell(settingsListCellType: .appLanguageCell, title: "settings_app_language_title".localized(), description: "settings_app_language_description".localized(), shouldShowToggle: false, shouldShowAccessory: true)

		let settingsItem2 = Settings.SettingsList.ViewModel.DisplayedSettingsCell(settingsListCellType: .notifsEndDriveCell, title: "settings_notif_end_drive_title".localized(), description: "settings_notif_end_drive_description".localized(), shouldShowToggle: true, shouldShowAccessory: false, toggleStatus: response.notifsEndDriveEnabled)

		let settingsItem3 = Settings.SettingsList.ViewModel.DisplayedSettingsCell(settingsListCellType: .notifsWarningCell, title: "settings_notif_end_drive_title".localized(), description: "settings_notif_app_closed_description".localized(), shouldShowToggle: true, shouldShowAccessory: false, toggleStatus: response.notifsWarningEnabled)

		let settingsItem4 = Settings.SettingsList.ViewModel.DisplayedSettingsCell(settingsListCellType: .gpsAccessCell, title: "settings_location_title".localized(), description: "settings_location_description".localized(), shouldShowToggle: true, shouldShowAccessory: false, toggleStatus: response.gpsEnabled)

		let settingsItem5 = Settings.SettingsList.ViewModel.DisplayedSettingsCell(settingsListCellType: .motionAccessCell, title: "settings_motion_title".localized(), description: "settings_motion_description".localized(), shouldShowToggle: true, shouldShowAccessory: false, toggleStatus: response.motionEnabled)

		let settingsItem6 = Settings.SettingsList.ViewModel.DisplayedSettingsCell(settingsListCellType: .exportDataCell, title: "settings_export_title".localized(), description: "settings_export_description".localized(), shouldShowToggle: false, shouldShowAccessory: true)

		let settingsItem7 = Settings.SettingsList.ViewModel.DisplayedSettingsCell(settingsListCellType: .feedbackCell, title: "settings_feedback_title".localized(), description: "settings_feedback_description".localized(), shouldShowToggle: false, shouldShowAccessory: true)

		let settingsItem8 = Settings.SettingsList.ViewModel.DisplayedSettingsCell(settingsListCellType: .appVersionCell, title: "settings_app_version_title".localized(), description: "1.0 (1)", shouldShowToggle: false, shouldShowAccessory: false)

		let array = [settingsItem1, settingsItem2, settingsItem3, settingsItem4, settingsItem5, settingsItem6, settingsItem7, settingsItem8]

    	let viewModel = Settings.SettingsList.ViewModel(displayedSettingsCells: array)
    	viewController?.displaySettingsList(viewModel: viewModel)
  	}
}
