       }
     }
   }
+}
+
+/// Model object for an `Alert` view.
+struct AlertItem: Identifiable {
+  var id = UUID()
+  var title: String
+  var message: String
 }
 
 /// A custom styled TextField with an SF symbol icon.

struct ContentView: View {
  @State private var email: String = ""
  @State private var isPresentingSheet = false

  var body: some View {
    NavigationView {

    actionCodeSettings.handleCodeInApp = true
    actionCodeSettings.setIOSBundleID(Bundle.main.bundleIdentifier!)

    Auth.auth().sendSignInLink(toEmail: email, actionCodeSettings: actionCodeSettings) { error in
      if let error = error {
        alertItem = AlertItem(
          title: "The sign in link could not be sent.",
          message: error.localizedDescription
        )
      }
    }
  }

  private func passwordlessSignIn(email: String, link: String,
