llama-stack-mirror/llama_stack/ui/components/chat-playground/prompt-suggestions.tsx
2025-08-14 15:58:43 -06:00

28 lines
752 B
TypeScript

interface PromptSuggestionsProps {
label: string;
append: (message: { role: "user"; content: string }) => void;
suggestions: string[];
}
export function PromptSuggestions({
label,
append,
suggestions,
}: PromptSuggestionsProps) {
return (
<div className="space-y-6">
<h2 className="text-center text-2xl font-bold">{label}</h2>
<div className="flex gap-6 text-sm">
{suggestions.map(suggestion => (
<button
key={suggestion}
onClick={() => append({ role: "user", content: suggestion })}
className="h-max flex-1 rounded-xl border bg-background p-4 hover:bg-muted"
>
<p>{suggestion}</p>
</button>
))}
</div>
</div>
);
}