Просмотр исходного кода

:sparkles: 根本义注复注对照

visuddhinanda 3 лет назад
Родитель
Сommit
e4bcdaa819

+ 2 - 1
dashboard/src/components/template/SentEdit.tsx

@@ -59,9 +59,10 @@ export const SentEditInner = ({
   originNum,
   simNum,
 }: IWidgetSentEditInner) => {
+  const sid = id.split("-");
   return (
     <Card bodyStyle={{ paddingBottom: 0 }} size="small">
-      <SentMenu>
+      <SentMenu book={parseInt(sid[0])} para={parseInt(sid[1])}>
         <SentContent
           sid={id}
           origin={origin}

+ 12 - 2
dashboard/src/components/template/SentEdit/SentMenu.tsx

@@ -2,20 +2,30 @@ import { useState } from "react";
 import { Button, Dropdown } from "antd";
 import { MoreOutlined } from "@ant-design/icons";
 import type { MenuProps } from "antd";
+import RelatedPara from "../../corpus/RelatedPara";
 
 const onClick: MenuProps["onClick"] = ({ key }) => {
   console.log(`Click on item ${key}`);
+  switch (key) {
+    case "show-commentary":
+      break;
+
+    default:
+      break;
+  }
 };
 
 interface ISentMenu {
+  book?: number;
+  para?: number;
   children?: React.ReactNode;
 }
-const Widget = ({ children }: ISentMenu) => {
+const Widget = ({ book, para, children }: ISentMenu) => {
   const [isHover, setIsHover] = useState(false);
   const items: MenuProps["items"] = [
     {
       key: "show-commentary",
-      label: "相关段落",
+      label: <RelatedPara book={book} para={para} />,
     },
     {
       key: "show-nissaya",