CommentTopic.tsx 724 B

12345678910111213141516171819202122232425262728
  1. import { Divider } from "antd";
  2. import CommentTopicInfo from "./CommentTopicInfo";
  3. import CommentTopicChildren from "./CommentTopicChildren";
  4. interface IWidget {
  5. topicId?: string;
  6. onItemCountChange?: Function;
  7. }
  8. const CommentTopicWidget = ({ topicId, onItemCountChange }: IWidget) => {
  9. return (
  10. <div>
  11. <CommentTopicInfo topicId={topicId} />
  12. <Divider />
  13. <CommentTopicChildren
  14. topicId={topicId}
  15. onItemCountChange={(count: number, e: string) => {
  16. //把新建回答的消息传出去。
  17. if (typeof onItemCountChange !== "undefined") {
  18. onItemCountChange(count, e);
  19. }
  20. }}
  21. />
  22. </div>
  23. );
  24. };
  25. export default CommentTopicWidget;