|
| 1 | +import type { ComponentType, SVGProps } from 'react' |
| 2 | +import Link from 'next/link' |
| 3 | +import { |
| 4 | + AgentIcon, |
| 5 | + ApiIcon, |
| 6 | + McpIcon, |
| 7 | + PackageSearchIcon, |
| 8 | + TableIcon, |
| 9 | + WorkflowIcon, |
| 10 | +} from '@/components/icons' |
| 11 | + |
| 12 | +interface ProductLink { |
| 13 | + label: string |
| 14 | + description: string |
| 15 | + href: string |
| 16 | + external?: boolean |
| 17 | + icon: ComponentType<SVGProps<SVGSVGElement>> |
| 18 | +} |
| 19 | + |
| 20 | +interface SidebarLink { |
| 21 | + label: string |
| 22 | + href: string |
| 23 | + external?: boolean |
| 24 | +} |
| 25 | + |
| 26 | +const PLATFORM: ProductLink[] = [ |
| 27 | + { |
| 28 | + label: 'Workflows', |
| 29 | + description: 'Visual AI automation builder', |
| 30 | + href: 'https://docs.sim.ai/getting-started', |
| 31 | + external: true, |
| 32 | + icon: WorkflowIcon, |
| 33 | + }, |
| 34 | + { |
| 35 | + label: 'Agent', |
| 36 | + description: 'Build autonomous AI agents', |
| 37 | + href: 'https://docs.sim.ai/blocks/agent', |
| 38 | + external: true, |
| 39 | + icon: AgentIcon, |
| 40 | + }, |
| 41 | + { |
| 42 | + label: 'MCP', |
| 43 | + description: 'Connect external tools', |
| 44 | + href: 'https://docs.sim.ai/mcp', |
| 45 | + external: true, |
| 46 | + icon: McpIcon, |
| 47 | + }, |
| 48 | + { |
| 49 | + label: 'Knowledge Base', |
| 50 | + description: 'Retrieval-augmented context', |
| 51 | + href: 'https://docs.sim.ai/knowledgebase', |
| 52 | + external: true, |
| 53 | + icon: PackageSearchIcon, |
| 54 | + }, |
| 55 | + { |
| 56 | + label: 'Tables', |
| 57 | + description: 'Structured data storage', |
| 58 | + href: 'https://docs.sim.ai/tables', |
| 59 | + external: true, |
| 60 | + icon: TableIcon, |
| 61 | + }, |
| 62 | + { |
| 63 | + label: 'API', |
| 64 | + description: 'Deploy workflows as endpoints', |
| 65 | + href: 'https://docs.sim.ai/api-reference/getting-started', |
| 66 | + external: true, |
| 67 | + icon: ApiIcon, |
| 68 | + }, |
| 69 | +] |
| 70 | + |
| 71 | +const EXPLORE: SidebarLink[] = [ |
| 72 | + { label: 'Models', href: '/models' }, |
| 73 | + { label: 'Integrations', href: '/integrations' }, |
| 74 | + { label: 'Changelog', href: '/changelog' }, |
| 75 | + { label: 'Self-hosting', href: 'https://docs.sim.ai/self-hosting', external: true }, |
| 76 | +] |
| 77 | + |
| 78 | +function DropdownLink({ link }: { link: ProductLink }) { |
| 79 | + const Icon = link.icon |
| 80 | + const Tag = link.external ? 'a' : Link |
| 81 | + const props = link.external |
| 82 | + ? { href: link.href, target: '_blank' as const, rel: 'noopener noreferrer' } |
| 83 | + : { href: link.href } |
| 84 | + |
| 85 | + return ( |
| 86 | + <Tag |
| 87 | + {...props} |
| 88 | + className='group/item flex items-start gap-2.5 rounded-[5px] px-2.5 py-2 transition-colors hover:bg-[var(--landing-bg-elevated)]' |
| 89 | + > |
| 90 | + <Icon className='mt-0.5 h-[15px] w-[15px] shrink-0 text-[var(--landing-text-icon)]' /> |
| 91 | + <div className='flex flex-col'> |
| 92 | + <span className='font-[430] font-season text-[13px] text-white leading-tight'> |
| 93 | + {link.label} |
| 94 | + </span> |
| 95 | + <span className='font-season text-[12px] text-[var(--landing-text-subtle)] leading-[150%]'> |
| 96 | + {link.description} |
| 97 | + </span> |
| 98 | + </div> |
| 99 | + </Tag> |
| 100 | + ) |
| 101 | +} |
| 102 | + |
| 103 | +export function ProductDropdown() { |
| 104 | + return ( |
| 105 | + <div className='flex w-[560px] rounded-[5px] border border-[var(--landing-bg-elevated)] bg-[var(--landing-bg)] shadow-overlay'> |
| 106 | + <div className='flex-1 p-2'> |
| 107 | + <div className='mb-1 px-2.5 pt-1'> |
| 108 | + <span className='font-[430] font-season text-[11px] text-[var(--landing-text-subtle)] uppercase tracking-[0.08em]'> |
| 109 | + Platform |
| 110 | + </span> |
| 111 | + <div className='mt-1.5 h-px bg-[var(--landing-bg-elevated)]' /> |
| 112 | + </div> |
| 113 | + |
| 114 | + <div className='grid grid-cols-2'> |
| 115 | + {PLATFORM.map((link) => ( |
| 116 | + <DropdownLink key={link.label} link={link} /> |
| 117 | + ))} |
| 118 | + </div> |
| 119 | + </div> |
| 120 | + |
| 121 | + <div className='w-px self-stretch bg-[var(--landing-bg-elevated)]' /> |
| 122 | + |
| 123 | + <div className='w-[160px] p-2'> |
| 124 | + <div className='mb-1 px-2.5 pt-1'> |
| 125 | + <span className='font-[430] font-season text-[11px] text-[var(--landing-text-subtle)] uppercase tracking-[0.08em]'> |
| 126 | + Explore |
| 127 | + </span> |
| 128 | + <div className='mt-1.5 h-px bg-[var(--landing-bg-elevated)]' /> |
| 129 | + </div> |
| 130 | + |
| 131 | + {EXPLORE.map((link) => { |
| 132 | + const Tag = link.external ? 'a' : Link |
| 133 | + const props = link.external |
| 134 | + ? { href: link.href, target: '_blank' as const, rel: 'noopener noreferrer' } |
| 135 | + : { href: link.href } |
| 136 | + return ( |
| 137 | + <Tag |
| 138 | + key={link.label} |
| 139 | + {...props} |
| 140 | + className='block rounded-[5px] px-2.5 py-1.5 font-[430] font-season text-[13px] text-white transition-colors hover:bg-[var(--landing-bg-elevated)]' |
| 141 | + > |
| 142 | + {link.label} |
| 143 | + </Tag> |
| 144 | + ) |
| 145 | + })} |
| 146 | + </div> |
| 147 | + </div> |
| 148 | + ) |
| 149 | +} |
0 commit comments