prompt-input-tooltip.tsx 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * Derived from vercel/ai-elements (skills/ai-elements/scripts/prompt-input-tooltip.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 {
  9. PromptInput,
  10. PromptInputBody,
  11. PromptInputButton,
  12. PromptInputFooter,
  13. PromptInputSubmit,
  14. PromptInputTextarea,
  15. PromptInputTools,
  16. } from "@/components/ai-elements/prompt-input";
  17. import { GlobeIcon, MicIcon, PaperclipIcon } from "lucide-react";
  18. const handleSubmit = () => {
  19. // Handle submit
  20. };
  21. const Example = () => (
  22. <PromptInput onSubmit={handleSubmit}>
  23. <PromptInputBody>
  24. <PromptInputTextarea />
  25. </PromptInputBody>
  26. <PromptInputFooter>
  27. <PromptInputTools>
  28. <PromptInputButton tooltip="Attach files">
  29. <PaperclipIcon size={16} />
  30. </PromptInputButton>
  31. <PromptInputButton tooltip={{ content: "Search the web", shortcut: "⌘K" }}>
  32. <GlobeIcon size={16} />
  33. </PromptInputButton>
  34. <PromptInputButton tooltip={{ content: "Voice input", shortcut: "⌘M", side: "bottom" }}>
  35. <MicIcon size={16} />
  36. </PromptInputButton>
  37. </PromptInputTools>
  38. <PromptInputSubmit />
  39. </PromptInputFooter>
  40. </PromptInput>
  41. );
  42. export default Example;