import React from 'react';
import { StyleSheet, Text, View, TouchableOpacity } from 'react-native';
import { Link, useNavigation } from 'expo-router';


const Index = () => {
  const navigation = useNavigation();
  const handleLogin = () => {
    navigation.navigate('Login');
  };
  const handleRegister = () => {
    navigation.navigate('Register');
  };

  return (
    <View style={styles.container}>
      <Text style={styles.text}>Welcome to</Text>
      <Text style={styles.text2}>OTPGen</Text>
      <Text style={[styles.text3,styles.firstLine]}>The Two-Step Authentication</Text>
      <Text style={[styles.text3, styles.secondLine]}>Password Generator</Text>
      <TouchableOpacity onPress={handleLogin} style={styles.button}>
        <Text style={styles.buttonText}>Login</Text>
      </TouchableOpacity>
      <TouchableOpacity onPress={handleRegister} style={styles.button2}>
        <Text style={styles.buttonText2}>Register</Text>
      </TouchableOpacity>
    </View>
  );
};

export default Index;



const styles = StyleSheet.create({
  text: {
    fontSize: 45,
    fontWeight: '600',
    marginBottom: -20,
    color: '#0075ff',
  },
  text2:{
    fontSize: 65,
    fontWeight:'700',
    color: '#0075ff',
  },
  text3:{
    color: '#0075ff',
    fontWeight: '600',
    fontSize: 18,
  },
  firstLine: {
    marginTop: 10,
  },
  secondLine: {
    marginBottom: 20,
  },
  link: {
    color: 'blue',
    marginBottom: 20,
    textAlign: 'center',
    fontSize: 20,
  },
  container: {
    marginTop: 50,
    flex: 1,
    padding: 20,
    justifyContent: 'flex-start',
    alignItems: 'center',
  },
  button: {
    padding: 10,
    borderRadius: 30,
    alignItems: 'center',
    backgroundColor: '#007BFF',
    width: '65%',
  },
  buttonText: {
    color: 'white',
    fontSize: 20,
    textAlign: 'center',
    padding: 5,
    fontWeight: '500',
  },
  button2: {
    padding: 10,
    borderRadius: 30,
    alignItems: 'center',
    backgroundColor: '#007BFF',
    width: '65%',
    marginTop: 10
  },
  buttonText2: {
    color: 'white',
    fontSize: 20,
    textAlign: 'center',
    padding: 5,
    fontWeight: '500',
  },
});
