mirror of
				https://github.com/meta-llama/llama-stack.git
				synced 2025-10-25 17:11:12 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			28 lines
		
	
	
	
		
			752 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			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>
 | |
|   );
 | |
| }
 |