//
//  MenuSettingView.swift
//  Sailassist
//
//  Created by Mamoru Sugita on 2023/11/21.
//

import SwiftUI

struct MenuSettingView: View {
    @Environment(\.openURL) private var openURL
    @Binding var path : [MenuPath]
    var body: some View {
        VStack{
            MenuTitleView(path: $path, title: MenuPath.Setting.title)
            
            Button{
                path.append(.GpsSelect)
            }label: {
                MenuContentView(content: .GpsSelect)
            }
            
            Button{
                path.append(.Help)
            }label: {
                MenuContentView(content: .Help)
            }
            
            Button{
                path.append(.AboutApp)
            }label: {
                MenuContentView(content: .AboutApp)
            }
            
            Button{
                if let url = URL(string: HttpRequestType.ContactPage.rawValue) {
                    openURL(url)
                }
            }label: {
                MenuContentView(content: .ContactUs)
            }
            
            Spacer()
        }
        .background(ColorSet.BackgroundPrimary.color)
    }
}

#Preview {
    MenuSettingView(path: .constant([.Setting]))
}

