import { useRouter } from 'expo-router'
import { FAB, List, Surface } from 'react-native-paper'
import * as SecureStore from 'expo-secure-store'

export default function HistoryScreen() {
  const router = useRouter()
  const isLoggedIn = SecureStore.getItem("apiToken") !== null
  return (
    <Surface
      style={{ flex: 1 }}>
      <List.Item
          title="Connexion au serveur"
          description={isLoggedIn ? "Vous êtes déjà connecté⋅e" : "Vous n'êtes pas connecté⋅e"}
          right={() => <FAB icon="login" size="small" onPress={() => router.navigate('/login')} />}
          onPress={() => router.navigate('/login')} />
    </Surface>
  )
}
