visuddhinanda 3 лет назад
Родитель
Сommit
48afc2d2c9
1 измененных файлов с 23 добавлено и 4 удалено
  1. 23 4
      dashboard/src/pages/library/community/list.tsx

+ 23 - 4
dashboard/src/pages/library/community/list.tsx

@@ -9,12 +9,12 @@ import BookTree from "../../../components/corpus/BookTree";
 import ChapterFilter from "../../../components/corpus/ChapterFilter";
 import ChapterFilter from "../../../components/corpus/ChapterFilter";
 import ChapterList from "../../../components/corpus/ChapterList";
 import ChapterList from "../../../components/corpus/ChapterList";
 import ChapterTagList from "../../../components/corpus/ChapterTagList";
 import ChapterTagList from "../../../components/corpus/ChapterTagList";
+import ChapterTag from "../../../components/corpus/ChapterTag";
+import ChapterAppendTag from "../../../components/corpus/ChapterAppendTag";
 
 
 const { Title } = Typography;
 const { Title } = Typography;
 const Widget = () => {
 const Widget = () => {
-  // TODO
-  const defaultTags: string[] = [];
-  const [tags, setTags] = useState(defaultTags);
+  const [tags, setTags] = useState<string[]>([]);
   const [progress, setProgress] = useState(0.9);
   const [progress, setProgress] = useState(0.9);
   const [lang, setLang] = useState("zh");
   const [lang, setLang] = useState("zh");
   const [type, setType] = useState("translation");
   const [type, setType] = useState("translation");
@@ -57,7 +57,26 @@ const Widget = () => {
         <Title level={3}>
         <Title level={3}>
           <Space>
           <Space>
             <TagOutlined />
             <TagOutlined />
-            {tags}
+            {tags.map((item, id) => {
+              return (
+                <ChapterTag
+                  data={{
+                    key: item,
+                    title: item,
+                  }}
+                  key={id}
+                />
+              );
+            })}
+            <ChapterAppendTag
+              tags={tags}
+              progress={progress}
+              lang={lang}
+              type={type}
+              onTagClick={(tag: string) => {
+                setTags([...tags, tag]);
+              }}
+            />
           </Space>
           </Space>
         </Title>
         </Title>