//
//  MainMenu.swift
//  ArkitDoushiQi
//
//  Created by Johan LACHENAL on 16/05/2024.
//

import SwiftUI

struct MainMenu: View {
    let playButtonText : String
    let registeredGamesButtonText : String
    let ParametersButtontText : String
    @State private var action: Int? = 0
    @AppStorage("isDarkMode") private var isDarkMode = false
    var body: some View {
        ZStack {
            NavigationView {
                    VStack {
                        Spacer()
                        HStack() {
                            Text("DouShiQi")
                                .bold()
                                .font(.title).padding()
                        }
                        Spacer().frame(height: 40)
                        VStack(alignment: .leading) {
                            ButtonComponent(title: playButtonText)
                            { GameParametersMenuView() }
                            Spacer().frame(height: 30)
                            ButtonComponent(title: registeredGamesButtonText)
                            { Text("parties enregistrées page") }
                            Spacer().frame(height: 30)
                            ButtonComponent(title: ParametersButtontText)
                            { GeneralParametersMenuView() }
                        }
                        Spacer()
                    }
                    .padding(EdgeInsets(top: 10, leading: 32, bottom: 10, trailing: 32))
                }
            }
    }
}

struct MainMenu_Previews: PreviewProvider {
    static var previews: some View {
        MainMenu(playButtonText: "Jouer", registeredGamesButtonText: "Parties enregistrées",ParametersButtontText: "Paramètres")
    }
}
