suggestion.tsx 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * Derived from vercel/ai-elements (skills/ai-elements/scripts/suggestion.tsx).
  3. * Copyright 2023 Vercel, Inc. Licensed under Apache-2.0.
  4. * Modified by ZCode: local integration, formatting and adaptations.
  5. * See THIRD-PARTY-NOTICES.md in the repository root for license and provenance.
  6. */
  7. "use client";
  8. import { Suggestion, Suggestions } from "@/components/ai-elements/suggestion";
  9. const suggestions = [
  10. "What are the latest trends in AI?",
  11. "How does machine learning work?",
  12. "Explain quantum computing",
  13. "Best practices for React development",
  14. "Tell me about TypeScript benefits",
  15. "How to optimize database queries?",
  16. "What is the difference between SQL and NoSQL?",
  17. "Explain cloud computing basics",
  18. ];
  19. const handleSuggestionClick = (suggestion: string) => {
  20. console.log("Selected suggestion:", suggestion);
  21. };
  22. const Example = () => (
  23. <Suggestions>
  24. {suggestions.map((suggestion) => (
  25. <Suggestion key={suggestion} onClick={handleSuggestionClick} suggestion={suggestion} />
  26. ))}
  27. </Suggestions>
  28. );
  29. export default Example;