aboutsummaryrefslogtreecommitdiff
path: root/apps/web/src/components/SearchResults.tsx
diff options
context:
space:
mode:
authorYash <[email protected]>2024-04-11 04:52:44 +0000
committerYash <[email protected]>2024-04-11 04:52:44 +0000
commit6dcc7d18c9be5e3a5e0a3ff60668424ee0158b4e (patch)
tree179aa936536510cc707368fc7c330c4c7fbdc3f8 /apps/web/src/components/SearchResults.tsx
parentnovel editor (diff)
parentsave user ID with url to ensure that same website can be saved by users (diff)
downloadsupermemory-new-ui.tar.xz
supermemory-new-ui.zip
Merge branch 'main' of https://github.com/Dhravya/supermemory into new-uinew-ui
Diffstat (limited to 'apps/web/src/components/SearchResults.tsx')
-rw-r--r--apps/web/src/components/SearchResults.tsx40
1 files changed, 40 insertions, 0 deletions
diff --git a/apps/web/src/components/SearchResults.tsx b/apps/web/src/components/SearchResults.tsx
new file mode 100644
index 00000000..d348814e
--- /dev/null
+++ b/apps/web/src/components/SearchResults.tsx
@@ -0,0 +1,40 @@
+"use client";
+
+import React from "react";
+import { Card, CardContent } from "./ui/card";
+import Markdown from "react-markdown";
+import remarkGfm from "remark-gfm";
+
+function SearchResults({
+ aiResponse,
+ sources,
+}: {
+ aiResponse: string;
+ sources: string[];
+}) {
+ return (
+ <div
+ style={{
+ backgroundImage: `linear-gradient(to right, #E5D9F2, #CDC1FF)`,
+ }}
+ className="mx-auto mt-4 w-full max-w-2xl space-y-6 rounded-xl border px-4 py-6"
+ >
+ <div className="text-start">
+ <div className="text-xl text-black">
+ <Markdown remarkPlugins={[remarkGfm]}>
+ {aiResponse.replace("</s>", "")}
+ </Markdown>
+ </div>
+ </div>
+ <div className="grid gap-6">
+ {sources.map((value, index) => (
+ <Card key={index}>
+ <CardContent className="space-y-2">{value}</CardContent>
+ </Card>
+ ))}
+ </div>
+ </div>
+ );
+}
+
+export default SearchResults;