|
@@ -1,3 +1,4 @@
|
|
|
|
|
+import Exercise from "./Exercise";
|
|
|
import Note from "./Note";
|
|
import Note from "./Note";
|
|
|
import Quote from "./Quote";
|
|
import Quote from "./Quote";
|
|
|
import SentEdit from "./SentEdit";
|
|
import SentEdit from "./SentEdit";
|
|
@@ -9,8 +10,9 @@ import Wd from "./Wd";
|
|
|
interface IWidgetMdTpl {
|
|
interface IWidgetMdTpl {
|
|
|
tpl?: string;
|
|
tpl?: string;
|
|
|
props?: string;
|
|
props?: string;
|
|
|
|
|
+ children?: React.ReactNode;
|
|
|
}
|
|
}
|
|
|
-const Widget = ({ tpl, props }: IWidgetMdTpl) => {
|
|
|
|
|
|
|
+const Widget = ({ tpl, props, children }: IWidgetMdTpl) => {
|
|
|
switch (tpl) {
|
|
switch (tpl) {
|
|
|
case "term":
|
|
case "term":
|
|
|
return <Term props={props ? props : ""} />;
|
|
return <Term props={props ? props : ""} />;
|
|
@@ -20,12 +22,14 @@ const Widget = ({ tpl, props }: IWidgetMdTpl) => {
|
|
|
return <SentRead props={props ? props : ""} />;
|
|
return <SentRead props={props ? props : ""} />;
|
|
|
case "sentedit":
|
|
case "sentedit":
|
|
|
return <SentEdit props={props ? props : ""} />;
|
|
return <SentEdit props={props ? props : ""} />;
|
|
|
- case "wbw_sent":
|
|
|
|
|
- return <WbwSent props={props ? props : ""} />;
|
|
|
|
|
|
|
+ case "wbw_sent":
|
|
|
|
|
+ return <WbwSent props={props ? props : ""} />;
|
|
|
case "wd":
|
|
case "wd":
|
|
|
return <Wd props={props ? props : ""} />;
|
|
return <Wd props={props ? props : ""} />;
|
|
|
case "quote":
|
|
case "quote":
|
|
|
return <Quote props={props ? props : ""} />;
|
|
return <Quote props={props ? props : ""} />;
|
|
|
|
|
+ case "exercise":
|
|
|
|
|
+ return <Exercise props={props ? props : ""}>{children}</Exercise>;
|
|
|
default:
|
|
default:
|
|
|
return <>未定义模版({tpl})</>;
|
|
return <>未定义模版({tpl})</>;
|
|
|
}
|
|
}
|