sources.tsx 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * Derived from vercel/ai-elements (skills/ai-elements/scripts/sources.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 { Source, Sources, SourcesContent, SourcesTrigger } from "@/components/ai-elements/sources";
  9. const sources = [
  10. { href: "https://stripe.com/docs/api", title: "Stripe API Documentation" },
  11. { href: "https://docs.github.com/en/rest", title: "GitHub REST API" },
  12. {
  13. href: "https://docs.aws.amazon.com/sdk-for-javascript/",
  14. title: "AWS SDK for JavaScript",
  15. },
  16. ];
  17. const Example = () => (
  18. <div style={{ height: "110px" }}>
  19. <Sources>
  20. <SourcesTrigger count={sources.length} />
  21. <SourcesContent>
  22. {sources.map((source) => (
  23. <Source href={source.href} key={source.href} title={source.title} />
  24. ))}
  25. </SourcesContent>
  26. </Sources>
  27. </div>
  28. );
  29. export default Example;