Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
Mirrored from https://github.com/Camo67/composio.git
Synced Nov 21, 03:37 UTC
| 1 | import Link from 'next/link'; |
| 2 | import Image from 'next/image'; |
| 3 | import { PROVIDERS, type Provider, type ProviderGroup } from '@/lib/providers'; |
| 4 | |
| 5 | function ProviderCard({ name, href, logo, logoDark, languages, experimental }: Provider) { |
| 6 | return ( |
| 7 | <Link |
| 8 | href={href} |
| 9 | className="flex items-center gap-5 rounded-lg border border-fd-border bg-fd-card p-5 transition-all hover:bg-fd-accent/50 hover:border-[color-mix(in_srgb,var(--composio-orange)_50%,transparent)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2" |
| 10 | > |
| 11 | <div className="flex h-12 w-12 shrink-0 items-center justify-center"> |
| 12 | {logo && logoDark ? ( |
| 13 | <> |
| 14 | <Image |
| 15 | src={logo} |
| 16 | alt={`${name} logo`} |
| 17 | width={48} |
| 18 | height={48} |
| 19 | className="h-10 w-auto dark:hidden" |
| 20 | /> |
| 21 | <Image |
| 22 | src={logoDark} |
| 23 | alt={`${name} logo`} |
| 24 | width={48} |
| 25 | height={48} |
| 26 | className="h-10 w-auto hidden dark:block" |
| 27 | /> |
| 28 | </> |
| 29 | ) : logo ? ( |
| 30 | <Image |
| 31 | src={logo} |
| 32 | alt={`${name} logo`} |
| 33 | width={48} |
| 34 | height={48} |
| 35 | className="h-10 w-auto" |
| 36 | /> |
| 37 | ) : ( |
| 38 | <span className="text-2xl font-bold text-fd-muted-foreground/40"> |
| 39 | {name.charAt(0)} |
| 40 | </span> |
| 41 | )} |
| 42 | </div> |
| 43 | |
| 44 | <div className="flex flex-col justify-center gap-2"> |
| 45 | <span className="text-sm font-semibold text-fd-foreground">{name}</span> |
| 46 | {experimental && <span className="text-xs text-fd-muted-foreground">Experimental</span>} |
| 47 | {languages && languages.length > 0 && ( |
| 48 | <div className="flex gap-2"> |
| 49 | {languages.map((lang) => ( |
| 50 | <span |
| 51 | key={lang} |
| 52 | className="rounded border border-fd-border bg-fd-muted/50 px-2 py-0.5 text-xs text-fd-muted-foreground" |
| 53 | > |
| 54 | {lang} |
| 55 | </span> |
| 56 | ))} |
| 57 | </div> |
| 58 | )} |
| 59 | </div> |
| 60 | </Link> |
| 61 | ); |
| 62 | } |
| 63 | |
| 64 | export function ProviderList({ group }: { group: ProviderGroup }) { |
| 65 | return ( |
| 66 | <ul className="not-prose m-0 grid list-none grid-cols-1 gap-3 p-0 sm:grid-cols-2"> |
| 67 | {PROVIDERS[group].map(provider => ( |
| 68 | <li key={provider.name}> |
| 69 | <ProviderCard {...provider} /> |
| 70 | </li> |
| 71 | ))} |
| 72 | </ul> |
| 73 | ); |
| 74 | } |