Sfoglia il codice sorgente

add onSearch in <Dictionary />

visuddhinanda 2 anni fa
parent
commit
afeeec3428
1 ha cambiato i file con 10 aggiunte e 1 eliminazioni
  1. 10 1
      dashboard/src/components/dict/DictComponent.tsx

+ 10 - 1
dashboard/src/components/dict/DictComponent.tsx

@@ -19,7 +19,16 @@ const DictComponentWidget = ({ word }: IWidgetDict) => {
     }
     }
   }, [searchWord]);
   }, [searchWord]);
 
 
-  return <Dictionary word={wordSearch} compact={true} />;
+  return (
+    <Dictionary
+      word={wordSearch}
+      compact={true}
+      onSearch={(value: string) => {
+        console.debug("onSearch", value);
+        store.dispatch(lookup(value));
+      }}
+    />
+  );
 };
 };
 
 
 export default DictComponentWidget;
 export default DictComponentWidget;