import SwiftUI

struct ContentView: View {
    @Environment(SyncEngine.self) private var syncEngine

    var body: some View {
        if syncEngine.iCloudStatus == .unavailable {
            ICloudGateView()
        } else {
            TabView {
                Tab("Notes", systemImage: "square.and.pencil") {
                    NotesListView()
                }

                Tab("Tags", systemImage: "tag") {
                    TagsView()
                }

                Tab("Settings", systemImage: "gearshape") {
                    SettingsView()
                }

                // role: .search renders as the separated magnifier tab at the
                // trailing edge of the tab bar on iOS 26.
                Tab("Search", systemImage: "magnifyingglass", role: .search) {
                    SearchView()
                }
            }
        }
    }
}
