//
//  ContentView.swift
//  FastCoster
//
//  Created by Michael Pivato on 1/2/2023.
//

import SwiftUI

enum ProcessType: String, Hashable {
    case MoveMoney = "Move Money"
    case OverheadAllocation = "Overhead Allocation"
    
    // TODO: This needs to be the list of graphs
    static let values = [MoveMoney, OverheadAllocation]
}

struct ContentView: View {
    
    @State var selectedProcess: ProcessType?

    var body: some View {
        NavigationSplitView {
            List(ProcessType.values, id: \.self, selection: $selectedProcess) { process in
                NavigationLink(process.rawValue, value: process)
            }
        } detail: {
            if let process = selectedProcess {
                switch process {
                case .MoveMoney:
                    MoveMoney()
                
                case .OverheadAllocation:
                    OverheadAllocation()
                }
            } else {
                MoveMoney()
            }
        }
    }
    // TODO: Button to add a new graph
    
}

struct ContentView_Previews: PreviewProvider {
    static var previews: some View {
        ContentView()
    }
}
