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

//MARK: Bluetooth Icon: https://upload.wikimedia.org/wikipedia/commons/d/da/Bluetooth.svg

import SwiftUI

struct ContentView: View {
    #if os(iOS)
    private static let isPhone: Bool = UIDevice.current.userInterfaceIdiom == .phone
    #else
    private static let isPhone: Bool = false
    #endif

    var body: some View {
        if Self.isPhone {
            navigationViewPhone
        } else {
            navigationViewPad
        }
    }

    @ViewBuilder
    private var navigationViewPhone: some View {
        NavigationView {
            SidebarView()
                .navigationBarTitle(Text("USB Meters"), displayMode: .inline)
        }
        .navigationViewStyle(.stack)
    }

    @ViewBuilder
    private var navigationViewPad: some View {
        NavigationView {
            SidebarView()
                .navigationBarTitle(Text("USB Meters"), displayMode: .inline)
        }
        .navigationViewStyle(.columns)
    }
}
