Spaces:
Configuration error
Configuration error
File size: 504 Bytes
dad4133 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
import React from "react";
import "./ExamplePrompts.css";
export default function ExamplePrompts({ prompts, onSelect }) {
return (
<div className="example-prompts-box">
<h3>Example Prompts</h3>
<ul>
{prompts.map((prompt, i) => (
<li key={i} onClick={() => onSelect(prompt)} tabIndex={0} onKeyDown={e => {
if(e.key === 'Enter' || e.key === ' ') onSelect(prompt);
}}>
{prompt}
</li>
))}
</ul>
</div>
);
}
|