import { Search as SearchIcon, Settings } from "lucide-react"; import { useNavigate } from "react-router-dom"; import { SearchInput } from "@/components/SearchInput"; import { CategoryTabs } from "@/components/CategoryTabs"; import { ResultCard } from "@/components/ResultCard"; import { ResultSkeleton } from "@/components/ResultSkeleton"; import { useSearch } from "@/hooks/use-search"; const Index = () => { const { query, results, isLoading, hasSearched, activeCategory, filteredResults, search, setCategory, setQuery, reset } = useSearch(); const navigate = useNavigate(); const settingsButton = ( ); // Home state if (!hasSearched) { return (
{settingsButton}

Private meta-search, powered by open source.

); } // Results state return (
{settingsButton}
{isLoading ? ( ) : filteredResults && filteredResults.length > 0 ? ( <>

About {results?.number_of_results} results for "{results?.query}"

{filteredResults.map((result, i) => ( ))}
{results?.suggestions && results.suggestions.length > 0 && (

Related searches

{results.suggestions.map((s) => ( ))}
)} ) : (

No results found for this category.

)}
); }; export default Index;