import { getClassOverride, twMerge } from "../utils"; import SearchBar from "../components/SearchBar"; import { INTRO_TITLE_ID, PROMPT_ID, SUGGESTIONS_ID, SUGGESTIONS_TITLE_ID, } from "../utils/constants"; import { useConfiguration } from "../context/ConfigurationProvider"; import PlaceholderPrompt from "../components/PlaceholderPrompt"; import { useTracker } from "../context/TrackerProvider"; const Home = ({ shouldShow, prompts, searchInputRef, searchTerm, setSearchTerm, submitSearch, isStreamActive, setStopStream, }: { prompts: string[] | null; shouldShow: boolean; searchInputRef: React.RefObject; searchTerm: string; setSearchTerm: React.Dispatch>; submitSearch: (_value: string) => void; isStreamActive: boolean; setStopStream: (_: boolean) => void; }) => { const tracker = useTracker(); const configuration = useConfiguration(); return (
{configuration?.copy?.introTitle || "I can help you find what you're looking for"}
) => setSearchTerm(e.target.value) } handleSubmit={(e: React.FormEvent) => { e.preventDefault(); if (!isStreamActive && searchTerm.length > 0) { submitSearch(searchTerm); } }} isStreamActive={isStreamActive} innerRef={searchInputRef} stopStream={(stop: boolean) => setStopStream(stop)} />

{configuration?.copy?.suggestionsTitle || "THINGS YOU SHOULD KNOW"}

{prompts && prompts.length > 0 ? ( prompts.map((prompt: any) => ( )) ) : ( <> )}
); }; export default Home;