import React, { useState } from 'react'; import { View, StyleSheet } from 'react-native'; import { Button, Text, Surface } from 'react-native-paper'; import { SafeAreaView } from 'react-native-safe-area-context'; import { useDispatch } from 'react-redux'; import { authApi } from '../../lib/api/auth'; import { setUser, setError } from '../../store/slices/authSlice'; export function LoginScreen() { const dispatch = useDispatch(); const [loading, setLoading] = useState(false); const handleLogin = async () => { setLoading(true); try { const user = await authApi.login(); dispatch(setUser(user)); } catch (err) { const message = err instanceof Error ? err.message : 'Login failed. Please try again.'; dispatch(setError(message)); } finally { setLoading(false); } }; return ( Sea Haven Industries Proposal System Submit and manage proposals from anywhere Use your Sea Haven Workspace account ); } const styles = StyleSheet.create({ container: { flex: 1, backgroundColor: '#FAFAFA', }, content: { flex: 1, justifyContent: 'center', alignItems: 'center', paddingHorizontal: 32, }, logoContainer: { alignItems: 'center', marginBottom: 32, backgroundColor: 'transparent', }, brand: { fontWeight: '800', color: '#1565C0', }, brandSub: { color: '#757575', marginTop: -4, }, title: { fontWeight: '700', color: '#212121', marginBottom: 8, }, subtitle: { color: '#757575', textAlign: 'center', marginBottom: 48, }, actions: { width: '100%', }, buttonContent: { paddingVertical: 8, }, button: { borderRadius: 8, }, footer: { color: '#9E9E9E', marginTop: 24, }, });