2021-03-09 12:39:13 +00:00
|
|
|
/**
|
|
|
|
* Copyright (c) 2021 lingdocs.com
|
|
|
|
*
|
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
|
* LICENSE file in the root directory of this source tree.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
import Pashto from "./Pashto";
|
|
|
|
import Phonetics from "./Phonetics";
|
|
|
|
import * as T from "../types";
|
|
|
|
|
|
|
|
function InlinePs ({
|
|
|
|
children,
|
|
|
|
ps,
|
|
|
|
opts,
|
|
|
|
}: {
|
2021-06-24 08:22:19 +00:00
|
|
|
ps?: T.PsString | (T.PsJSX & { e?: string }),
|
|
|
|
children: T.PsString | (T.PsJSX & { e?: string }),
|
2021-03-09 12:39:13 +00:00
|
|
|
opts: T.TextOptions,
|
|
|
|
}) {
|
|
|
|
const text = children || ps;
|
|
|
|
return (
|
|
|
|
<span>
|
|
|
|
<Pashto opts={opts}>{text}</Pashto>
|
|
|
|
{opts.phonetics !== "none" && " - "}
|
|
|
|
<Phonetics opts={opts}>{text}</Phonetics>
|
|
|
|
{text.e && <span className="text-muted"> ({text.e})</span>}
|
|
|
|
</span>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
export default InlinePs;
|