Skip to content

Commit d56a922

Browse files
authored
Handle new-style suggestions (#152)
1 parent e93daaf commit d56a922

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

apps/web/src/app/(authenticated)/usage/Messages.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@ type MessagesProps = {
99
messages: Message[];
1010
};
1111

12+
type SuggestionItem = string | { answer: string };
13+
1214
type QuestionData = {
1315
question: string;
14-
suggestions: string[];
16+
suggestions: SuggestionItem[];
1517
};
1618

1719
const parseQuestionData = (text: string): QuestionData | null => {
@@ -97,7 +99,9 @@ export const Messages = ({ messages }: MessagesProps) => {
9799
key={index}
98100
className="px-4 py-3 bg-background border border-border rounded-md text-sm hover:bg-muted/50 cursor-pointer transition-colors"
99101
>
100-
{suggestion}
102+
{typeof suggestion === 'string'
103+
? suggestion
104+
: suggestion.answer}
101105
</div>
102106
))}
103107
</div>

0 commit comments

Comments
 (0)