visuddhinanda 2 лет назад
Родитель
Сommit
00c9d28794
1 измененных файлов с 20 добавлено и 17 удалено
  1. 20 17
      dashboard/src/components/discussion/DiscussionListCard.tsx

+ 20 - 17
dashboard/src/components/discussion/DiscussionListCard.tsx

@@ -79,20 +79,19 @@ const DiscussionListCardWidget = ({
           title: {
             render(dom, entity, index, action, schema) {
               return (
-                <>
-                  <Button
-                    size="small"
-                    type="link"
-                    icon={entity.newTpl ? <TemplateOutlinedIcon /> : undefined}
-                    onClick={(event) => {
-                      if (typeof onSelect !== "undefined") {
-                        onSelect(event, entity);
-                      }
-                    }}
-                  >
-                    {entity.title}
-                  </Button>
-                </>
+                <Button
+                  key={index}
+                  size="small"
+                  type="link"
+                  icon={entity.newTpl ? <TemplateOutlinedIcon /> : undefined}
+                  onClick={(event) => {
+                    if (typeof onSelect !== "undefined") {
+                      onSelect(event, entity);
+                    }
+                  }}
+                >
+                  {entity.title}
+                </Button>
               );
             },
           },
@@ -100,15 +99,19 @@ const DiscussionListCardWidget = ({
             dataIndex: "content",
             search: false,
             render(dom, entity, index, action, schema) {
-              return entity.summary ? entity.summary : entity.content;
+              return (
+                <span key={index}>
+                  {entity.summary ? entity.summary : entity.content}
+                </span>
+              );
             },
           },
           actions: {
             render: (text, row, index, action) => [
               row.childrenCount ? (
                 <Space key={index}>
-                  <CommentOutlinedIcon />
-                  {row.childrenCount}
+                  <CommentOutlinedIcon key={"icon"} />
+                  <span key={"count"}>{row.childrenCount}</span>
                 </Space>
               ) : (
                 <></>