import { useState } from "react"; import { ChatHandler, SuggestedQuestionsData } from ".."; export function SuggestedQuestions({ questions, append, }: { questions: SuggestedQuestionsData; append: Pick["append"]; }) { const [showQuestions, setShowQuestions] = useState(questions.length > 0); return ( showQuestions && append !== undefined && (
{questions.map((question, index) => ( { append({ role: "user", content: question }); setShowQuestions(false); }} className="text-sm italic hover:underline cursor-pointer" > {"->"} {question} ))}
) ); }