diff --git a/package.json b/package.json
index 28f6769..d7f5c00 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "@lingdocs/pashto-inflector",
- "version": "0.4.5",
+ "version": "0.4.6",
"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/Pashto.tsx b/src/components/Pashto.tsx
index 7bad88a..b64388c 100644
--- a/src/components/Pashto.tsx
+++ b/src/components/Pashto.tsx
@@ -27,19 +27,21 @@ const Pashto = ({ opts, children: text }: {
? p
: convertAfToPkSpelling(p);
}
- if (typeof text.p !== "string" && typeof text.f !== "string") {
- return psJSXMap(
- text as T.PsJSX,
- "p",
- (ps: T.PsString) => convertText(ps, opts),
- );
- }
const style = opts.pTextSize === "normal"
? undefined
: { fontSize: opts.pTextSize === "larger" ? "large" : "larger" };
return (
- {convertText(text as T.PsString, opts)}
+ {(typeof text.p !== "string" && typeof text.f !== "string")
+ ?
+ psJSXMap(
+ text as T.PsJSX,
+ "p",
+ (ps: T.PsString) => convertText(ps, opts),
+ )
+ :
+ convertText(text as T.PsString, opts)
+ }
);
};
diff --git a/src/components/Phonetics.tsx b/src/components/Phonetics.tsx
index b6577d2..9d6d19d 100644
--- a/src/components/Phonetics.tsx
+++ b/src/components/Phonetics.tsx
@@ -28,12 +28,10 @@ const Phonetics = ({ opts, children: text }: {
system: opts.phonetics,
})
);
- if (typeof text !== "string" && typeof text.f !== "string") {
- return psJSXMap(text as T.PsJSX, "f", ({f}) => handleText(f));
- }
- const f = typeof text === "string" ? text : text.f as string;
return
- {handleText(f)}
+ {(typeof text !== "string" && typeof text.f !== "string")
+ ? psJSXMap(text as T.PsJSX, "f", ({f}) => handleText(f))
+ : handleText(typeof text === "string" ? text : text.f as string)}
};