//
//  ControlView.swift
//  USB Meter
//
//  Created by Bogdan Timofte on 09/03/2020.
//  Copyright © 2020 Bogdan Timofte. All rights reserved.
//

import SwiftUI

struct ControlView: View {
    
    @EnvironmentObject private var meter: Meter

    var body: some View {
        HStack {
            VStack {
                HStack {
                    Button(action: { self.meter.rotateScreen() }, label: { Image(systemName: "arrow.clockwise") })
                }
                HStack {
                    Button(action: { self.meter.previousScreen() }, label: { Image(systemName: "arrowtriangle.left") })
                    Text("Current Screen: \(meter.currentScreen)")
                    Button(action: { self.meter.nextScreen() }, label: { Image(systemName: "arrowtriangle.right") })
                }
            }
        }
    }
}

struct ControlView_Previews: PreviewProvider {
    static var previews: some View {
        ControlView()
    }
}
