import {Link, router, Stack, usePathname, useRouter} from 'expo-router';
import {Button, StyleSheet, Text, View} from 'react-native';


export default function NotFoundScreen() {
  const pathname = usePathname();
  const router = useRouter();

  return (
    <>
      <Stack.Screen options={{ title: 'Oops!' }} />
      <View style={styles.container}>
        <Text>This screen {pathname} doesn't exist: {pathname}</Text>
        <Button title="Retour Home" onPress={() => router.replace("/")}/>
          <Text>Go to home screen!</Text>
      </View>
    </>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    alignItems: 'center',
    justifyContent: 'center',
    padding: 20,
  },
  link: {
    marginTop: 15,
    paddingVertical: 15,
  },
});
