This commit is contained in:
lingdocs 2022-04-12 17:19:33 +05:00
parent e9f9bd2b3c
commit 912a7f8e99
1 changed files with 43 additions and 0 deletions

View File

@ -0,0 +1,43 @@
import {
defaultTextOptions,
VPExplorer,
EntrySelect,
Types as T,
} from "@lingdocs/pashto-inflector";
import {
nouns,
verbs,
} from "../words/words";
import { useStickyState } from "@lingdocs/pashto-inflector";
function VPBuilder() {
const [entry, setEntry] = useStickyState<T.VerbEntry | undefined>(undefined, "vEntrySelect");
return <div>
<div style={{ maxWidth: "300px" }}>
<div className="h5">Verb:</div>
<EntrySelect
value={entry}
onChange={setEntry}
entries={verbs}
opts={defaultTextOptions}
isVerbSelect
name="Verb"
/>
</div>
<div style={{ margin: "0 auto" }}>
{entry
? <VPExplorer
verb={entry}
opts={defaultTextOptions}
nouns={nouns}
verbs={verbs}
/>
: <div className="lead">
Choose a verb to start building
</div>}
</div>
</div>;
}
export default VPBuilder;