diff --git a/web/src/components/Header.astro b/web/src/components/Header.astro
index a7cb544..8102063 100644
--- a/web/src/components/Header.astro
+++ b/web/src/components/Header.astro
@@ -4,10 +4,10 @@ const links = [
txt: "new",
lnk: "/recipe/new"
},
- {
- txt: "add",
- lnk: "/recipe/import"
- },
+ // {
+ // txt: "add",
+ // lnk: "/recipe/import"
+ // },
{
txt: "tags",
lnk: "/tags"
diff --git a/web/src/pages/search.astro b/web/src/pages/search.astro
new file mode 100644
index 0000000..d850a8e
--- /dev/null
+++ b/web/src/pages/search.astro
@@ -0,0 +1,88 @@
+---
+import { Recipe } from "@tmlmt/cooklang-parser"
+import { authPB } from "@data/pb";
+import RecipeCard from "@component/index/card"
+import Base from "@layout/Base";
+
+const pb = await authPB()
+
+// Get search query from URL
+const url = new URL(Astro.request.url);
+const query = url.searchParams.get('q') || '';
+
+let recipes: Recipe[] = [];
+let ids: string[] = [];
+let images: string[] = [];
+let totalResults = 0;
+
+if (query) {
+ // Search in title, description, and cooklang content
+ const result = await pb.collection('recipes').getList(1, 50, {
+ filter: `cooklang ~ "${query}"`
+ });
+
+ totalResults = result.totalItems;
+ recipes = result.items.map((r: any) => new Recipe(r.cooklang));
+ ids = result.items.map((r: any) => r.id);
+ images = await Promise.all(
+ result.items.map((r: any) => '/api' + pb.files.getURL(r, r.images[0]).split('api')[1])
+ );
+}
+---
+
+
+ {totalResults} result{totalResults !== 1 ? 's' : ''} for "{query}" +
+ )} +No recipes found
+Try a different search term
+Start searching for recipes
+Enter a search term above to find your favorite recipes
+