Skip to content

Commit

Permalink
Remove search suggestions (for now) 👀
Browse files Browse the repository at this point in the history
  • Loading branch information
wotschofsky committed Aug 2, 2024
1 parent 671ccba commit 56e2118
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 53 deletions.
13 changes: 1 addition & 12 deletions app/_components/search-form.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
'use client';

import { useDebounce } from '@uidotdev/usehooks';
import { Loader2Icon, SearchIcon } from 'lucide-react';
import { usePlausible } from 'next-plausible';
import { usePathname, useRouter } from 'next/navigation';
Expand All @@ -16,7 +15,6 @@ import {
useState,
} from 'react';
import { useHotkeys } from 'react-hotkeys-hook';
import useSWR from 'swr';

import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
Expand All @@ -38,17 +36,8 @@ const normalizeDomain = (input: string) => {
};

const useSuggestions = (domain: string) => {
const debouncedDomain = useDebounce(domain, 200);

const { data: suggestions } = useSWR<string[]>(
domain
? `/api/search-suggestions?q=${encodeURIComponent(debouncedDomain.toLowerCase())}`
: null,
{ keepPreviousData: true }
);

return {
suggestions: domain ? suggestions : EXAMPLE_DOMAINS,
suggestions: domain ? [] : EXAMPLE_DOMAINS,
};
};

Expand Down
41 changes: 0 additions & 41 deletions app/api/search-suggestions/route.ts

This file was deleted.

0 comments on commit 56e2118

Please sign in to comment.