//
// © 2017-2020 Qualcomm Technologies, Inc. and/or its subsidiaries. All rights reserved.
//

import UIKit

enum TextViewControllerContents {
    case none
    case legalNotices
    case termsOfService
}

class TextViewController: ModalViewController {
    @IBOutlet weak var text: UITextView?
    
    var contents: TextViewControllerContents = .none {
        didSet {
            loadText()
        }
    }
}

extension TextViewController {
    override func viewDidLoad() {
        hasCloseButton = navigationController?.children.count ?? 0 < 2
        super.viewDidLoad()
        loadText()
    }
    
    private func loadText() {
        switch contents {
        case .legalNotices,
             .termsOfService:
            text?.text = "PLEASE NOTE:\n\nBY USING THIS RELEASE YOU ACCEPT THAT IT IS SUBJECT TO THE PRODUCT KIT LICENSE AGREEMENT THAT YOU HAVE ACCEPTED ELECTRONICALLY, A COPY OF WHICH IS AVAILABLE AT\n\nhttps://createpoint.qti.qualcomm.com/dashboard/pkla/license."
        default:
            break
        }
    }
}
