import { View, Text, TextInput, TouchableOpacity, KeyboardAvoidingView, Platform, ActivityIndicator, } from 'react-native' import { useState } from 'react' import { useRouter } from 'expo-router' import { authClient } from '@/lib/auth-client' import { SafeAreaView } from 'react-native-safe-area-context' export default function LoginScreen() { const router = useRouter() const [email, setEmail] = useState('') const [loading, setLoading] = useState(false) const [error, setError] = useState('') async function handleSendLink() { if (!email.trim()) return setLoading(true) setError('') const result = await authClient.signIn.magicLink({ email: email.trim().toLowerCase(), callbackURL: '/news', }) setLoading(false) if (result.error) { setError(result.error.message ?? 'Ein Fehler ist aufgetreten.') } else { router.push({ pathname: '/(auth)/check-email', params: { email } }) } } return ( {/* Logo */} I InnungsApp Die digitale Plattform Ihrer Innung {/* Form */} E-Mail-Adresse {error ? ( {error} ) : null} {loading ? ( ) : ( Magic Link senden )} Kein Passwort nötig — Zugang nur per Admin-Einladung ) }