diff options
Diffstat (limited to 'apps/web/src/components/SearchResults.tsx')
| -rw-r--r-- | apps/web/src/components/SearchResults.tsx | 40 |
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; |