mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-26 01:06:23 +02:00
feat: add react-rough-notation dependency and update chat components for improved UI
This commit is contained in:
parent
237e11f2ae
commit
1e05c5e9da
6 changed files with 360 additions and 252 deletions
|
|
@ -3,43 +3,43 @@
|
|||
import { SuggestedQuestions } from "@llamaindex/chat-ui/widgets";
|
||||
import { getAnnotationData, Message, useChatUI } from "@llamaindex/chat-ui";
|
||||
import {
|
||||
Accordion,
|
||||
AccordionContent,
|
||||
AccordionItem,
|
||||
AccordionTrigger,
|
||||
Accordion,
|
||||
AccordionContent,
|
||||
AccordionItem,
|
||||
AccordionTrigger,
|
||||
} from "@/components/ui/accordion";
|
||||
|
||||
export const ChatFurtherQuestions: React.FC<{ message: Message }> = ({
|
||||
message,
|
||||
message,
|
||||
}) => {
|
||||
const annotations: string[][] = getAnnotationData(
|
||||
message,
|
||||
"FURTHER_QUESTIONS",
|
||||
);
|
||||
const { append, requestData } = useChatUI();
|
||||
const annotations: string[][] = getAnnotationData(
|
||||
message,
|
||||
"FURTHER_QUESTIONS",
|
||||
);
|
||||
const { append, requestData } = useChatUI();
|
||||
|
||||
if (annotations.length !== 1 || annotations[0].length === 0) {
|
||||
return <></>;
|
||||
}
|
||||
if (annotations.length !== 1 || annotations[0].length === 0) {
|
||||
return <></>;
|
||||
}
|
||||
|
||||
return (
|
||||
<Accordion
|
||||
type="single"
|
||||
collapsible
|
||||
className="w-full px-2 border-2 rounded-lg shadow-lg"
|
||||
>
|
||||
<AccordionItem value="suggested-questions">
|
||||
<AccordionTrigger className="text-sm font-semibold">
|
||||
Suggested Questions
|
||||
</AccordionTrigger>
|
||||
<AccordionContent>
|
||||
<SuggestedQuestions
|
||||
questions={annotations[0]}
|
||||
append={append}
|
||||
requestData={requestData}
|
||||
/>
|
||||
</AccordionContent>
|
||||
</AccordionItem>
|
||||
</Accordion>
|
||||
);
|
||||
return (
|
||||
<Accordion
|
||||
type="single"
|
||||
collapsible
|
||||
className="w-full border rounded-md bg-card shadow-sm"
|
||||
>
|
||||
<AccordionItem value="suggested-questions" className="border-0">
|
||||
<AccordionTrigger className="px-4 py-3 text-sm font-medium text-foreground transition-colors">
|
||||
Further Suggested Questions
|
||||
</AccordionTrigger>
|
||||
<AccordionContent className="px-4 pb-4 pt-0">
|
||||
<SuggestedQuestions
|
||||
questions={annotations[0]}
|
||||
append={append}
|
||||
requestData={requestData}
|
||||
/>
|
||||
</AccordionContent>
|
||||
</AccordionItem>
|
||||
</Accordion>
|
||||
);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue