Tukvaysi support
This commit is contained in:
parent
9192e070e1
commit
f4e674c88f
21
src/App.tsx
21
src/App.tsx
@ -2,7 +2,7 @@ import React, {useState} from 'react';
|
||||
|
||||
import './App.scss';
|
||||
import {declineSaimiar} from './saimiar_morphology';
|
||||
import {SaiEntryProps, JutEntryProps, ElesuEntryProps} from './dbtypes';
|
||||
import {SaiEntryProps, JutEntryProps, ElesuEntryProps, TukEntryProps} from './dbtypes';
|
||||
|
||||
const backendUrl = 'https://kucinakobackend.ichigo.everydayimshuflin.com';
|
||||
|
||||
@ -58,7 +58,7 @@ function buildRequest(searchTerm: string, conlang: Conlang, direction: SearchDir
|
||||
|
||||
interface EntryProps {
|
||||
conlang: Conlang;
|
||||
entry: SaiEntryProps | JutEntryProps | ElesuEntryProps;
|
||||
entry: SaiEntryProps | JutEntryProps | ElesuEntryProps | TukEntryProps;
|
||||
key: string;
|
||||
}
|
||||
|
||||
@ -76,7 +76,9 @@ const Entry = (props: EntryProps) => {
|
||||
return <ElesuEntry entry={ props.entry as ElesuEntryProps } />;
|
||||
}
|
||||
|
||||
return <div>Conlang { conlang } not yet supported</div>;
|
||||
if (conlang === Conlang.Tukvaysi) {
|
||||
return <TukEntry entry={ props.entry as TukEntryProps } />;
|
||||
}
|
||||
};
|
||||
|
||||
const SaiEntry = (props: {entry: SaiEntryProps}) => {
|
||||
@ -123,6 +125,19 @@ const ElesuEntry = (props: {entry: ElesuEntryProps}) => {
|
||||
</div>);
|
||||
};
|
||||
|
||||
const TukEntry = (props: {entry: TukEntryProps}) => {
|
||||
const {entry} = props;
|
||||
|
||||
return (
|
||||
<div className="searchResult" key={ entry.id }>
|
||||
<b>{ entry.tuk }</b> - { entry.eng }
|
||||
<br/>
|
||||
<span className="synclass">
|
||||
{ entry.syn_category }
|
||||
</span>
|
||||
</div>);
|
||||
};
|
||||
|
||||
function formatMorphology(entry) {
|
||||
const decl = declineSaimiar(entry);
|
||||
if (!decl) {
|
||||
|
@ -27,4 +27,12 @@ interface ElesuEntryProps {
|
||||
proto_southern_root: string;
|
||||
}
|
||||
|
||||
export {SaiEntryProps, JutEntryProps, ElesuEntryProps};
|
||||
interface TukEntryProps {
|
||||
id: number;
|
||||
tuk: string;
|
||||
eng: string;
|
||||
syn_category: string;
|
||||
notes: string;
|
||||
}
|
||||
|
||||
export {SaiEntryProps, JutEntryProps, ElesuEntryProps, TukEntryProps};
|
||||
|
Loading…
Reference in New Issue
Block a user