Преглед изворни кода

IWidgetDictContentData -> IDictContentData

visuddhinanda пре 3 година
родитељ
комит
f430953128

+ 3 - 3
dashboard/src/components/dict/DictContent.tsx

@@ -9,7 +9,7 @@ import CaseList from "./CaseList";
 import DictList from "./DictList";
 import DictList from "./DictList";
 import MyCreate from "./MyCreate";
 import MyCreate from "./MyCreate";
 
 
-export interface IWidgetDictContentData {
+export interface IDictContentData {
   dictlist: IAnchorData[];
   dictlist: IAnchorData[];
   words: IWidgetWordCardData[];
   words: IWidgetWordCardData[];
   caselist: ICaseListData[];
   caselist: ICaseListData[];
@@ -17,12 +17,12 @@ export interface IWidgetDictContentData {
 export interface IApiDictContentData {
 export interface IApiDictContentData {
   ok: boolean;
   ok: boolean;
   message: string;
   message: string;
-  data: IWidgetDictContentData;
+  data: IDictContentData;
 }
 }
 
 
 interface IWidget {
 interface IWidget {
   word?: string;
   word?: string;
-  data: IWidgetDictContentData;
+  data: IDictContentData;
   compact?: boolean;
   compact?: boolean;
 }
 }
 
 

+ 3 - 6
dashboard/src/components/dict/DictSearch.tsx

@@ -1,9 +1,6 @@
 import { useState, useEffect } from "react";
 import { useState, useEffect } from "react";
 
 
-import type {
-  IWidgetDictContentData,
-  IApiDictContentData,
-} from "./DictContent";
+import type { IDictContentData, IApiDictContentData } from "./DictContent";
 import { get } from "../../request";
 import { get } from "../../request";
 
 
 import DictContent from "./DictContent";
 import DictContent from "./DictContent";
@@ -14,12 +11,12 @@ interface IWidget {
 }
 }
 
 
 const Widget = ({ word, compact = false }: IWidget) => {
 const Widget = ({ word, compact = false }: IWidget) => {
-  const defaultData: IWidgetDictContentData = {
+  const defaultData: IDictContentData = {
     dictlist: [],
     dictlist: [],
     words: [],
     words: [],
     caselist: [],
     caselist: [],
   };
   };
-  const [tableData, setTableData] = useState(defaultData);
+  const [tableData, setTableData] = useState<IDictContentData>(defaultData);
 
 
   useEffect(() => {
   useEffect(() => {
     if (typeof word === "undefined") {
     if (typeof word === "undefined") {