import SwiftUI

struct AuthNavigationBar: View {
    let title: String?
    let onBack: () -> Void

    init(title: String? = nil, onBack: @escaping () -> Void) {
        self.title = title
        self.onBack = onBack
    }

    var body: some View {
        HStack {
            GlassBackButton(action: onBack)
                .accessibilityLabel("Back")

            if let title {
                Text(title)
                    .font(.system(size: 18, weight: .semibold))
                    .foregroundStyle(.white)
            }

            Spacer()
        }
        .padding(.horizontal, 8)
        .padding(.vertical, 4)
    }
}

#Preview {
    AuthNavigationBar(title: "Set Password", onBack: {})
        .background(RosettaColors.authBackground)
}
