diff --git a/src/client/components/Search.tsx b/src/client/components/Search.tsx index 79f1461..a6b82ba 100644 --- a/src/client/components/Search.tsx +++ b/src/client/components/Search.tsx @@ -9,40 +9,70 @@ import ellipsize from "ellipsize"; import { useSelector, useDispatch } from "react-redux"; import { comicinfoAPICall } from "../actions/comicinfo.actions"; +import { Form, Field } from "react-final-form"; interface ISearchProps {} export const Search = ({}: ISearchProps): ReactElement => { + const formData = { + search: "", + }; const dispatch = useDispatch(); - const getCVSearchResults = useCallback(() => { - dispatch( - comicinfoAPICall({ - callURIAction: "search", - method: "GET", - params: { - api_key: "a5fa0663683df8145a85d694b5da4b87e1c92c69", - format: "json", - limit: "10", - offset: "0", - field_list: "id,name,deck,api_detail_url", - }, - }), - ); - }, [dispatch]); + const getCVSearchResults = useCallback( + (searchQuery) => { + console.log(searchQuery); + dispatch( + comicinfoAPICall({ + callURIAction: "search", + method: "GET", + params: { + api_key: "a5fa0663683df8145a85d694b5da4b87e1c92c69", + query: searchQuery, + format: "json", + limit: "10", + offset: "0", + field_list: "id,name,deck,api_detail_url", + resources: "volume", + }, + }), + ); + }, + [dispatch], + ); return ( <>
-
-
-

Search

- -
-
+

Search

+ +
( + +
+ + {({ input, meta }) => { + return ( + + ); + }} + +
+
+ +
+
+ )} + /> +