Ver Fonte

add onSearch in <Dictionary />

visuddhinanda há 2 anos atrás
pai
commit
afeeec3428
1 ficheiros alterados com 10 adições e 1 exclusões
  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]);
 
-  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;