import axios from "axios";
import * as Application from "expo-application";
import * as Device from "expo-device";
import { useRouter } from "expo-router";
import { useEffect, useState } from "react";
import { Alert, Platform, ScrollView, Text, View } from "react-native";
import HomeHeader from "../../components/HomeHeader";
import { hasValidSetup, type PersistedAppState } from "../../lib/storage";
import {
	evaluateVersion,
	type ServerVersionInfo,
	type StartupStatus,
} from "../../lib/versionValidation";
import { globalStyles } from "../../stlyes/global";

export default function Index() {
	return (
		<ScrollView>
			<View style={globalStyles.container}>
				<HomeHeader />

				<Text>Welcome. Blake</Text>
				<Text>Running on: {Platform.OS}</Text>
				<Text>Device model: {Device.modelName}</Text>
				<Text>Device Brand: {Device.brand}</Text>
				<Text> OS Version: {Device.osVersion}</Text>
				<View style={{ flex: 1, padding: 16, gap: 12 }}>
					<Text style={{ fontSize: 22, fontWeight: "600" }}>Welcome</Text>

					{/* {config ? (
						<>
							<Text>Server: {config.serverUrl}</Text>
							<Text>Scanner: {config.scannerId}</Text>
							<Text>Server: v{serverInfo?.versionName}</Text>
						</>
					) : (
						<Text>No config found yet.</Text>
					)} */}
				</View>
			</View>
		</ScrollView>
	);
}
