//
//  File.swift
//  NSApplication1.8
//
//  Created by DT Team  on 5/12/20.
//  Copyright © 2020 Amine. All rights reserved.
//


import Foundation
import UIKit


class AmoutView : UIView{

    @IBOutlet weak var amount_value: UILabel!
    @IBOutlet weak var amount_label: UILabel!
    @IBOutlet weak var sub_label: UILabel!
    
   
    required init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
    }
       
    override init(frame: CGRect) {
        super.init(frame: frame)
        
    }
  
    
    static func newInstance() ->  AmoutView{
          let view:AmoutView = UINib(nibName: "AmoutView", bundle: nil).instantiate(withOwner: nil, options: nil)[0] as! AmoutView
          return view
      }
    
    func setup(amount: String) -> AmoutView{
        
        amount_label.text = "TOTAL".localized
        amount_value.text = amount
        amount_label.initBolodFont()
        amount_value.initBolodFont()
        

        sub_label.initItalicFont(size: 12)
               
        
       sub_label.isHidden = true
        
        return self
    }
    
    func display_sub_label(title: String) {
        sub_label.text = title
        sub_label.isHidden = false
    }
    
    func hide_sub_label() {
         sub_label.isHidden = true
    }
    
    func setup(key: String,value: String) -> AmoutView{
           
           amount_label.text = key
           amount_value.text = value
           amount_label.initBolodFont()
           amount_value.initBolodFont()
        
        

         sub_label.initItalicFont(size: 12)
        
         sub_label.isHidden = true
           
           return self
       }

}
