|
|
@@ -34,6 +34,7 @@ interface IWidget {
|
|
|
onArticleChange?: Function;
|
|
|
onFinal?: Function;
|
|
|
onLoad?: Function;
|
|
|
+ onTitle?: Function;
|
|
|
}
|
|
|
const TypePaliWidget = ({
|
|
|
type,
|
|
|
@@ -48,6 +49,7 @@ const TypePaliWidget = ({
|
|
|
onArticleChange,
|
|
|
onFinal,
|
|
|
onLoad,
|
|
|
+ onTitle,
|
|
|
}: IWidget) => {
|
|
|
const [articleData, setArticleData] = useState<IArticleDataResponse>();
|
|
|
const [articleHtml, setArticleHtml] = useState<string[]>(["<span />"]);
|
|
|
@@ -139,6 +141,10 @@ const TypePaliWidget = ({
|
|
|
if (typeof onLoad !== "undefined") {
|
|
|
onLoad(json.data);
|
|
|
}
|
|
|
+ if (typeof onTitle !== "undefined") {
|
|
|
+ const bookTitle = json.data.path ? json.data.path[0].title : "";
|
|
|
+ onTitle(`${bookTitle}-${json.data.title}`);
|
|
|
+ }
|
|
|
} else {
|
|
|
message.error(json.message);
|
|
|
}
|