43 lines
882 B
TypeScript
43 lines
882 B
TypeScript
import { Translator } from "@/app/i18n/api";
|
|
import { Message, Speaker } from "@/app/lib/conversation";
|
|
import { useEffect, useState } from "react";
|
|
import { StyleSheet, Text } from "react-native";
|
|
import { SafeAreaView } from "react-native-safe-area-context";
|
|
|
|
type MessageProps = {
|
|
message: Message;
|
|
}
|
|
|
|
const MessageBubble = (props: MessageProps) => {
|
|
|
|
return (
|
|
<SafeAreaView>
|
|
{props.message.text && (
|
|
<Text>{props.message.text}</Text>
|
|
)}
|
|
{props.message.translation &&
|
|
<Text accessibilityHint="translation">{props.message.translation}</Text>
|
|
}
|
|
</SafeAreaView>
|
|
)
|
|
}
|
|
|
|
const bubbleStyle = StyleSheet.create({
|
|
host: {
|
|
|
|
},
|
|
guest: {
|
|
|
|
},
|
|
})
|
|
|
|
const textStyles = StyleSheet.create({
|
|
native: {
|
|
|
|
},
|
|
translation: {
|
|
|
|
},
|
|
});
|
|
|
|
export default MessageBubble; |