import { Search as SearchIcon } from "lucide-react"; import { searchCovers } from "@/lib/db/queries"; import { MasonryGrid } from "@/components/grid/MasonryGrid"; import { RegisterVisible } from "@/components/select/RegisterVisible"; export const dynamic = "force-dynamic"; export default async function SearchPage({ searchParams, }: { searchParams: Promise<{ q?: string | string[] }>; }) { const { q } = await searchParams; const query = (Array.isArray(q) ? q[0] ?? "" : q ?? "").trim(); const items = query ? searchCovers(query) : []; return (
{query ? `${items.length} match${items.length === 1 ? "" : "es"}` : "Type a code, title, director or notes phrase in the top bar."}