+
+ {selectedIndices.map((index, i) => {
+ const word = caption.timeline[index];
+ if (!word) return;
+ return (
+
+
+ {word.text}
+
+
+
+ {word.timeline
+ .map((t) =>
+ t.timeline.map((s) => convertIpaToNormal(s.text)).join("")
+ )
+ .join("")}
+
+
+
+ );
+ })}
+
+
+ {camdictResult && (
+ <>
+
+
+ {t("cambridgeDictionary")}
+
+
+ {camdictResult.posItems.map((posItem, index) => (
+
+
+
+ {posItem.type}
+
+
+ {posItem.pronunciations.map((pron, i) => (
+
+
+ [{pron.region}]
+
+
+ /{pron.pronunciation}/
+
+ {pron.audio && (
+
+
+
+
+ )}
+
+ ))}
+
+
+ {posItem.definitions.map((def, i) => (
+ -
+ {def.definition}
+
+ ))}
+
+
+ ))}
+
+ >
+ )}
+
+
+
+ {t("AiDictionary")}
+
+ {lookupResult ? (
+
+
+ {lookupResult.meaning?.pos && (
+
+ {lookupResult.meaning.pos}
+
+ )}
+ {lookupResult.meaning?.pronunciation && (
+
+ /{lookupResult.meaning.pronunciation}/
+
+ )}
+ {lookupResult.meaning?.lemma &&
+ lookupResult.meaning.lemma !== lookupResult.meaning.word && (
+ ({lookupResult.meaning.lemma})
+ )}
+
+
{lookupResult.meaning.translation}
+
{lookupResult.meaning.definition}
+
+ ) : (
+
+
+
+ )}
+
+
+
+
+
+ );
+};
+
+/*
+ * Translation tab content.
+ */
+const TranslationTabContent = (props: { text: string }) => {
+ const { text } = props;
+ const { EnjoyApp } = useContext(AppSettingsProviderContext);
+ const [translation, setTranslation] = useState