Răsfoiți Sursa

:construction: create

visuddhinanda 2 ani în urmă
părinte
comite
805754c4b3
1 a modificat fișierele cu 42 adăugiri și 0 ștergeri
  1. 42 0
      dashboard/src/components/article/TypeSeries.tsx

+ 42 - 0
dashboard/src/components/article/TypeSeries.tsx

@@ -0,0 +1,42 @@
+import { Typography } from "antd";
+import PaliTextToc from "./PaliTextToc";
+
+const { Title } = Typography;
+
+interface IWidget {
+  articleId?: string;
+  channelId?: string | null;
+  onArticleChange?: Function;
+}
+const TypeSeriesWidget = ({
+  channelId,
+  articleId,
+  onArticleChange,
+}: IWidget) => {
+  return (
+    <div>
+      <Title level={3}>
+        {"丛书:"}
+        {articleId}
+      </Title>
+      <Title level={4}>{"书目列表"}</Title>
+      <PaliTextToc
+        series={articleId}
+        onClick={(
+          id: string,
+          e: React.MouseEvent<HTMLSpanElement, MouseEvent>
+        ) => {
+          if (typeof onArticleChange !== "undefined") {
+            if (e.ctrlKey || e.metaKey) {
+              onArticleChange("chapter", id, "_blank");
+            } else {
+              onArticleChange("chapter", id, "_self");
+            }
+          }
+        }}
+      />
+    </div>
+  );
+};
+
+export default TypeSeriesWidget;