//
//  GamesView.swift
//  TwoRookstvOS
//
//  Created by Sam McBroom on 9/25/21.
//

import SwiftUI

struct GamesView: View {
	@StateObject private var settings = Settings()
	
	var body: some View {
		NavigationView {
			List {
				NavigationLink(destination: GameView(title: "♟")) {
					Label("Local", systemImage: "person.2")
						.symbolVariant(.fill)
						.foregroundColor(.primary)
						.contextMenu {
							Button("Reset local game", role: .destructive, action: GameState.reset)
						}
				}
				NavigationLink(destination: SettingsView()) {
					Label("Settings", systemImage: "gearshape")
				}
			}
			.navigationTitle("Games")
		}
		.environmentObject(settings)
	}
}
