import * as React from "react"; import SettingsComponent from "@/components/Settings"; import { LanguageSelection } from "@/components/LanguageSelection"; import { createNativeStackNavigator, NativeStackNavigationProp, } from "@react-navigation/native-stack"; import { useNavigation } from "@react-navigation/native"; import ConversationThread from "@/components/ConversationThread"; import { language_matrix_entry, Translator } from "@/app/i18n/api"; import { Conversation } from "@/app/lib/conversation"; import { Settings } from "@/app/lib/settings"; import { RootStackParamList } from "@/navigation.types"; const Stack = createNativeStackNavigator(); export default function TTNavStack() { const nav = useNavigation>() async function onLangSelected(lang: language_matrix_entry) { const settings = await Settings.getDefault(); const hostLanguage = await settings.getHostLanguage(); const conversation = new Conversation( await Translator.getDefault(lang.code), { id: "host", language: hostLanguage }, { id: "guest", language: lang.code } ); nav.navigate("ConversationThread", { conversation }); } return ( {(props) => ( )} ); }