blob: d348814e11b411cd2ed253dc2332241ad4711d24 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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;
|