diff --git a/src/App.tsx b/src/App.tsx index 2690501..fd2066b 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -44,20 +44,34 @@ function makeRequest(queryString, jsonHandler) { }); } -const Entry = (props) => { +interface EntryProps { + conlang: Conlang; + entry: SaiEntryProps | JutEntryProps; + key: string; +} + +const Entry = (props: EntryProps) => { const {conlang} = props; if (conlang === Conlang.Saimiar) { - return ; + return ; } if (conlang === Conlang.Juteyuji) { - return ; + return ; } return
Conlang { conlang } not yet supported
; }; -const SaiEntry = (props) => { +interface SaiEntryProps { + id: number; + sai: string; + eng: string; + syn_category: string; + morph_type: string; +} + +const SaiEntry = (props: {entry: SaiEntryProps}) => { const {entry} = props; const synCategory = entry.syn_category; const isNominal = synCategory === 'nominal'; @@ -75,7 +89,15 @@ const SaiEntry = (props) => { ); }; -const JutEntry = (props) => { +interface JutEntryProps { + id: number; + jut: string; + eng: string; + syn_category: string; + gender: string; +} + +const JutEntry = (props: {entry: JutEntryProps}) => { const {entry} = props; console.log(props); @@ -106,7 +128,14 @@ function formatMorphology(entry) { ); } -const Results = (props) => { +interface ResultsProps { + searchResults: any; + searchTerm: string; + conlang: Conlang; + direction: SearchDirection; +} + +const Results = (props: ResultsProps) => { const content = () => { const {conlang} = props; const num = props.searchResults.length;