Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
| 1 | import { ArrowUpRight } from 'lucide-react'; |
| 2 | import { |
| 3 | DOCS_PRODUCTS, |
| 4 | HOME_INTENTS, |
| 5 | homeIntentAnchor, |
| 6 | type HomeIntent, |
| 7 | } from '@/lib/home-navigation'; |
| 8 | import { ProductLockup } from './product-lockup'; |
| 9 | import { ProductSelectionLink } from './product-selection-link'; |
| 10 | import { SectionHeading } from './home-features'; |
| 11 | |
| 12 | export function HomeSurfaces() { |
| 13 | return ( |
| 14 | <section className="not-prose mb-14 pt-12 sm:pt-14" id="two-ways-to-start"> |
| 15 | <SectionHeading |
| 16 | eyebrow="Choose your path" |
| 17 | title="Start with the product that fits your work." |
| 18 | /> |
| 19 | <div className="grid grid-cols-1 gap-4 md:grid-cols-2"> |
| 20 | {HOME_INTENTS.map(intent => ( |
| 21 | <IntentCard key={intent.id} intent={intent} /> |
| 22 | ))} |
| 23 | </div> |
| 24 | </section> |
| 25 | ); |
| 26 | } |
| 27 | |
| 28 | function IntentCard({ intent }: { intent: HomeIntent }) { |
| 29 | return ( |
| 30 | <article className="flex min-w-0 flex-col overflow-hidden rounded-[14px] border border-fd-border bg-fd-card shadow-[0_1px_0_rgba(15,15,15,0.04)]"> |
| 31 | <ProductSelectionLink |
| 32 | className="group border-b border-fd-border bg-fd-background p-5 no-underline transition-colors hover:bg-fd-accent/25 focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-fd-ring" |
| 33 | href={DOCS_PRODUCTS[intent.productId].landingRoute} |
| 34 | product={intent.productId} |
| 35 | > |
| 36 | <div className="flex items-start justify-between gap-4"> |
| 37 | <div className="flex min-w-0 flex-col gap-2.5"> |
| 38 | <h3 className="flex items-center gap-2" id={homeIntentAnchor(intent.product)}> |
| 39 | <ProductLockup product={intent.productId} /> |
| 40 | </h3> |
| 41 | <p className="max-w-[42ch] text-pretty text-[15px] font-medium leading-[1.45] text-fd-foreground/85"> |
| 42 | {intent.description} |
| 43 | </p> |
| 44 | </div> |
| 45 | <ArrowUpRight |
| 46 | aria-hidden="true" |
| 47 | className="mt-1 size-3.5 shrink-0 text-fd-foreground/40 transition-transform group-hover:-translate-y-px group-hover:translate-x-px" |
| 48 | /> |
| 49 | </div> |
| 50 | </ProductSelectionLink> |
| 51 | <ul className="flex flex-col divide-y divide-fd-border"> |
| 52 | {intent.links.map(link => ( |
| 53 | <li className="flex" key={link.href}> |
| 54 | <ProductSelectionLink |
| 55 | className="group flex flex-1 items-center justify-between gap-4 px-5 py-3.5 no-underline transition-colors hover:bg-fd-accent/40" |
| 56 | href={link.href} |
| 57 | product={intent.productId} |
| 58 | > |
| 59 | <span className="flex min-w-0 flex-col gap-0.5"> |
| 60 | <span className="text-[13.5px] font-medium text-fd-foreground"> |
| 61 | {link.title} |
| 62 | </span> |
| 63 | <span className="text-[12px] leading-[1.45] text-fd-foreground/60"> |
| 64 | {link.description} |
| 65 | </span> |
| 66 | </span> |
| 67 | <ArrowUpRight |
| 68 | aria-hidden="true" |
| 69 | className="size-3.5 shrink-0 text-fd-foreground/50 transition-transform group-hover:-translate-y-px group-hover:translate-x-px" |
| 70 | /> |
| 71 | </ProductSelectionLink> |
| 72 | </li> |
| 73 | ))} |
| 74 | </ul> |
| 75 | </article> |
| 76 | ); |
| 77 | } |