Răsfoiți Sursa

add TypeCSPara

visuddhinanda 2 ani în urmă
părinte
comite
27e915f64d

+ 19 - 0
dashboard/src/components/api/Article.ts

@@ -214,3 +214,22 @@ export interface IPageNavItem {
   created_at: string;
   updated_at: string;
 }
+
+export interface ICSParaNavResponse {
+  ok: boolean;
+  data: ICSParaNavData;
+  message: string;
+}
+
+export interface ICSParaNavData {
+  curr: ICSParaNavItem;
+  prev?: ICSParaNavItem;
+  next?: ICSParaNavItem;
+  end: number;
+}
+
+export interface ICSParaNavItem {
+  book: number;
+  start: number;
+  content: string;
+}

+ 12 - 0
dashboard/src/components/article/Article.tsx

@@ -5,6 +5,7 @@ import TypeTerm from "./TypeTerm";
 import TypePali from "./TypePali";
 import "./article.css";
 import TypePage from "./TypePage";
+import TypeCSPara from "./TypeCSPara";
 
 export type ArticleMode = "read" | "edit" | "wbw";
 export type ArticleType =
@@ -149,6 +150,17 @@ const ArticleWidget = ({
             }
           }}
         />
+      ) : type === "cs-para" ? (
+        <TypeCSPara
+          articleId={articleId}
+          channelId={channelId}
+          mode={mode}
+          onArticleChange={(type: ArticleType, id: string) => {
+            if (typeof onArticleChange !== "undefined") {
+              onArticleChange(type, id);
+            }
+          }}
+        />
       ) : (
         <></>
       )}