diff --git a/src/components/MainSection.tsx b/src/components/MainSection.tsx new file mode 100644 index 0000000..3bc0ad1 --- /dev/null +++ b/src/components/MainSection.tsx @@ -0,0 +1,105 @@ +/* -------------------------------------------------------------------------- */ +/* Imports */ +/* -------------------------------------------------------------------------- */ +import classNames from "classnames"; +import React from "react"; +import Inputgroup from "./Inputgroup"; +import Select from "./Select"; +import { useState } from "react"; +import { Button } from "./Button/Button"; +import { SVGSearch } from "../components/icons"; +import SearchBar from "components/SearchBar"; + +type Props = { + className?: string; + options: T[]; + hintsValues: H[]; + displayValueResolver?: (element: T) => any; +}; + +/* -------------------------------------------------------------------------- */ +/* Component implementation */ +/* -------------------------------------------------------------------------- */ + +export default function MainSection({ + className, + options, + hintsValues, + displayValueResolver, + ...props +}: Props) { + const [value, setValue] = useState(options[0]); // Category + + const [hints, setHints] = useState([]); //Response list + const [onSelected, setOnSelected] = useState(""); // Selected item from response list + const [query, setQuery] = useState(""); // Query + + const onChange = (query: string) => { + //console.log(query) + setQuery(query); + setHints(hintsValues); + }; + const onClick = () => { + console.log(displayValueResolver ? displayValueResolver(value) : value); + console.log(onSelected); + console.log(query); + }; + const searchResolver = (item: any) => { + setOnSelected(item.caption); + console.log(onSelected); + }; + //empty items message + const IsEmptyItems = () => { + return

Nothing Found

; + }; + + return ( +
+
+ Scientific Library with Free Access +
+
+
Search
+
320 455
+
Items
+
+
+ +
+
+