import { useState } from 'react' import { View, Text, TextInput, TouchableOpacity, StyleSheet, ActivityIndicator, } from 'react-native' import { useAdminAuth } from '../../src/admin/components/AdminAuthProvider' export default function AdminLoginScreen() { const [email, setEmail] = useState('') const [password, setPassword] = useState('') const [error, setError] = useState('') const { signIn, isLoading } = useAdminAuth() const handleLogin = async () => { if (!email || !password) { setError('Please enter both email and password') return } setError('') try { await signIn(email, password) } catch (err) { setError(err instanceof Error ? err.message : 'Login failed') } } return ( TabataFit Admin Sign in to manage content {error ? {error} : null} {isLoading ? ( ) : ( Sign In )} ) } const styles = StyleSheet.create({ container: { flex: 1, backgroundColor: '#000', justifyContent: 'center', alignItems: 'center', padding: 20, }, card: { backgroundColor: '#1C1C1E', borderRadius: 16, padding: 32, width: '100%', maxWidth: 400, }, title: { fontSize: 28, fontWeight: 'bold', color: '#fff', marginBottom: 8, }, subtitle: { fontSize: 16, color: '#999', marginBottom: 24, }, errorText: { color: '#FF3B30', marginBottom: 16, }, input: { backgroundColor: '#2C2C2E', borderRadius: 8, padding: 16, marginBottom: 16, color: '#fff', fontSize: 16, }, button: { backgroundColor: '#FF6B35', borderRadius: 8, padding: 16, alignItems: 'center', }, buttonText: { color: '#000', fontSize: 16, fontWeight: 'bold', }, })