diff --git a/package.json b/package.json index ce6863e..fb323a1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@lingdocs/pashto-inflector", - "version": "0.3.7", + "version": "0.3.8", "author": "lingdocs.com", "description": "A Pashto inflection and verb conjugation engine, inculding React components for displaying Pashto text, inflections, and conjugations", "homepage": "https://verbs.lingdocs.com", diff --git a/src/components/Examples.tsx b/src/components/Examples.tsx index 18c4ba4..90803dd 100644 --- a/src/components/Examples.tsx +++ b/src/components/Examples.tsx @@ -10,17 +10,19 @@ import Pashto from "./Pashto"; import Phonetics from "./Phonetics"; import * as T from "../types"; -export default function({ +type PsStringWSub = T.PsString & { sub?: any }; + +function Examples({ children, ex, opts, }: { - ex?: T.PsString | T.PsString[], - children: T.PsString | T.PsString[], + ex?: PsStringWSub | PsStringWSub[], + children: PsStringWSub | PsStringWSub[], opts: T.TextOptions, }) { const examples = children || ex; - const Example = ({ children: text }: { children: T.PsString }) => ( + const Example = ({ children: text }: { children: PsStringWSub }) => (
{text} @@ -31,6 +33,9 @@ export default function({ {text.e &&
{text.e}
} + {text.sub &&
+ {text.sub} +
}
); return Array.isArray(examples) ? @@ -39,4 +44,6 @@ export default function({
: {examples}; -} \ No newline at end of file +} + +export default Examples; \ No newline at end of file