fix: add column to posts table that is a string of content to use search index on

This commit is contained in:
Stevan Freeborn
2023-09-16 10:53:28 -05:00
parent 18cb4fe0d9
commit e2161e62c3
6 changed files with 53 additions and 21 deletions
+26
View File
@@ -0,0 +1,26 @@
import SearchResults from '@/components/SearchResults';
export default function SearchPage({
searchParams,
}: {
searchParams: { [key: string]: string | string[] | undefined };
}) {
let term = searchParams.term;
if (term === undefined) {
term = '';
}
if (Array.isArray(term)) {
term = term.length > 0 ? term[0] : '';
}
return (
<main className='flex flex-col items-center flex-1'>
<div className='flex flex-col w-full max-w-4xl gap-4'>
<h1 className='text-4xl font-bold'>Here&apos;s what we found</h1>
<SearchResults term={term} />
</div>
</main>
);
}