visuddhinanda il y a 2 ans
Parent
commit
fa33dcb08b
1 fichiers modifiés avec 18 ajouts et 4 suppressions
  1. 18 4
      dashboard/src/components/discussion/DiscussionTopic.tsx

+ 18 - 4
dashboard/src/components/discussion/DiscussionTopic.tsx

@@ -2,15 +2,29 @@ import { Divider } from "antd";
 
 
 import CommentTopicInfo from "./DiscussionTopicInfo";
 import CommentTopicInfo from "./DiscussionTopicInfo";
 import CommentTopicChildren from "./DiscussionTopicChildren";
 import CommentTopicChildren from "./DiscussionTopicChildren";
+import { IComment } from "./DiscussionItem";
 
 
 interface IWidget {
 interface IWidget {
   topicId?: string;
   topicId?: string;
   onItemCountChange?: Function;
   onItemCountChange?: Function;
+  onTopicReady?: Function;
 }
 }
-const DiscussionTopicWidget = ({ topicId, onItemCountChange }: IWidget) => {
+const DiscussionTopicWidget = ({
+  topicId,
+  onTopicReady,
+  onItemCountChange,
+}: IWidget) => {
   return (
   return (
-    <div>
-      <CommentTopicInfo topicId={topicId} />
+    <>
+      <CommentTopicInfo
+        topicId={topicId}
+        onReady={(value: IComment) => {
+          console.log("on Topic Ready", value);
+          if (typeof onTopicReady !== "undefined") {
+            onTopicReady(value);
+          }
+        }}
+      />
       <Divider />
       <Divider />
       <CommentTopicChildren
       <CommentTopicChildren
         topicId={topicId}
         topicId={topicId}
@@ -21,7 +35,7 @@ const DiscussionTopicWidget = ({ topicId, onItemCountChange }: IWidget) => {
           }
           }
         }}
         }}
       />
       />
-    </div>
+    </>
   );
   );
 };
 };