import SwiftUI

struct GassiView: View {
    @State private var tab: Tab = .treffen

    private enum Tab: String, CaseIterable, Identifiable {
        case treffen     = "Treffen"
        case stammGassis = "Stamm-Gassis"
        var id: String { rawValue }
    }

    var body: some View {
        VStack(spacing: 0) {
            Picker("Bereich", selection: $tab) {
                ForEach(Tab.allCases) { t in
                    Text(t.rawValue).tag(t)
                }
            }
            .pickerStyle(.segmented)
            .padding(.horizontal)
            .padding(.top, 8)

            Divider()
                .padding(.top, 8)

            switch tab {
            case .treffen:
                GassiTreffenList()
            case .stammGassis:
                StammGassisList()
            }
        }
        .navigationTitle("Gassi-Treffen")
        .navigationBarTitleDisplayMode(.inline)
    }
}
