//
//  MainView.swift
//  AcaMate
//
//  Created by TAnine on 2/4/25.
//

import SwiftUI
import Combine

struct MainView: View {
    @EnvironmentObject var appVM: AppViewModel
    @State var cancellables: Set<AnyCancellable> = []
//    @Binding var naviState : NaviState
    
    @State private var myType: UserType = .Admin
    
    var body: some View {
        
        VStack(spacing: 0) {
            Group {
                switch appVM.menuName {
                case .Home:
                    HomeView(myType: $myType)
                case .Management:
                    ManagementView()
                case .Chatting:
                    ChattingView(appVM, $myType)
                case .Calendar:
                    CalendarView()
                case .Etc:
                    EtcView(myType: $myType)
                }
            }
//            Spacer(minLength: 1)
            
            BottomView()
                .frame(maxWidth: .infinity)
        }
        .frame(maxWidth: .infinity, maxHeight: .infinity)

    }
}


