Explorar o código

add onSearch in <Dictionary />

visuddhinanda %!s(int64=2) %!d(string=hai) anos
pai
achega
afeeec3428
Modificáronse 1 ficheiros con 10 adicións e 1 borrados
  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;