//
//  CustomNavigationView.swift
//  Toolboxes
//
//  Created by 研发2组 on 2024/9/24.
//

import SwiftUI

struct CustomNavigationView<Content: View>: View {
    let content: Content

    var body: some View {
        NavigationView {
            content
                .navigationBarBackButtonHidden(true)
                .navigationBarItems(leading: BackButton())
        }
    }
}

struct BackButton: View {
    @Environment(\.presentationMode) var presentationMode

    var body: some View {
        Button(action: {
            presentationMode.wrappedValue.dismiss() // 返回上一页
        }) {
            Image(systemName: "chevron.left")
                .foregroundColor(.black)
        }
    }
}

