2025-01-29 17:17:59 -08:00

46 lines
1.2 KiB
TypeScript

import { LanguageSelection } from '@/components/LanguageSelection';
import { useState } from 'react';
import { Text } from 'react-native';
import { Image, StyleSheet, Platform } from 'react-native';
import { Conversation, Speaker } from '../lib/conversation';
import { language_matrix_entry, Translator } from '../i18n/api';
import ConversationThread from '@/components/ConversationThread';
export default function HomeScreen() {
const [language, setLanguage] = useState<language_matrix_entry | undefined>()
const [conversation, setConversation] = useState<Conversation|undefined>();
return (
conversation ? <ConversationThread conversation={conversation} /> :
<LanguageSelection onLanguageSelected={
(language) => {
setConversation(new Conversation(
new Translator("en", language.code),
{id: "host", language: "en"},
{id: "guest", language: language.code},
))
}
} />
);
}
const styles = StyleSheet.create({
titleContainer: {
flexDirection: 'row',
alignItems: 'center',
gap: 8,
},
stepContainer: {
gap: 8,
marginBottom: 8,
},
reactLogo: {
height: 178,
width: 290,
bottom: 0,
left: 0,
position: 'absolute',
},
});