import React, { useState } from "react"; import { SearchBlockProps } from "./types"; import { Button } from "@shared/components/button"; import { Input } from "@shared/components/input"; import { MaterialIcon } from "@shared/components/material-icon"; import { Text } from "@shared/components/text"; import { cx } from "@shared/utils"; export const SearchBlock: React.FC = props => { const { anchorId = "SearchBlock", title, subTitle, enableHeading, searchDescription, searchInputPlaceholder, basicCaption, caption, backgroundColor, color, onSubmit, } = props; const [searchText, setSearchText] = useState(""); const themeColorClasses = { supporting: "bg-bg-fill-brand-supporting", white: "bg-bg", brand: "bg-bg-fill-brand", }; const handleSubmit = (e: React.FormEvent) => { e.preventDefault(); onSubmit?.({ searchText }); }; return (
{title} {subTitle && ( {subTitle} )}
{searchDescription ? ( {searchDescription} ) : null}
}; }) => setSearchText(e.target.value)} placeholder={searchInputPlaceholder} containerClassName="px-4 pl-0 rounded-md flex-grow border-none" className={"body3 rounded-md text-text"} />
{caption ? caption : null} {basicCaption}
); }; export default SearchBlock;