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 { cn } from '@/lib/utils'; |
| 2 | |
| 3 | /** |
| 4 | * "Legacy" badge rendered at the top of a docs page (under the title) when the |
| 5 | * page frontmatter sets `legacy: true` — for guides superseded by sessions but |
| 6 | * kept for existing integrations. The "Written <date>" stamp is separate (see |
| 7 | * the `written` frontmatter field), so a current, dated guide can show its date |
| 8 | * without being marked legacy. |
| 9 | */ |
| 10 | interface LegacyBadgeProps { |
| 11 | title?: string; |
| 12 | className?: string; |
| 13 | } |
| 14 | |
| 15 | export const DEPRECATED_API_LEGACY_TITLE = |
| 16 | 'Deprecated API endpoint; kept for existing integrations and may be removed in a future release'; |
| 17 | |
| 18 | export function LegacyBadge({ |
| 19 | title = 'Legacy: superseded by sessions; kept for existing integrations', |
| 20 | className, |
| 21 | }: LegacyBadgeProps) { |
| 22 | return ( |
| 23 | <span |
| 24 | title={title} |
| 25 | className={cn( |
| 26 | 'not-prose inline-flex w-fit items-center gap-1.5 rounded-md border border-fd-border bg-fd-muted px-2 py-0.5 text-xs font-medium uppercase tracking-wide text-fd-muted-foreground', |
| 27 | className |
| 28 | )} |
| 29 | > |
| 30 | Legacy |
| 31 | </span> |
| 32 | ); |
| 33 | } |
| 34 | |
| 35 | export function DeprecatedApiLegacyBadge({ className }: { className?: string }) { |
| 36 | return <LegacyBadge title={DEPRECATED_API_LEGACY_TITLE} className={className} />; |
| 37 | } |
| 38 | |
| 39 | export function DeprecatedApiSidebarLegacyBadge() { |
| 40 | return ( |
| 41 | <DeprecatedApiLegacyBadge className="ml-1 align-middle rounded px-1.5 py-px text-[10px]" /> |
| 42 | ); |
| 43 | } |