Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
TypeScript agentic-aiagentsaiai-agentsaiagentsdeveloper-toolsfunction-callinggpt-4javascriptjsllmllmopsmcppythonremote-mcp-serverssetypescript
feat(docs): add themed Decimal chat widget and update nav
Sushmithamalleshd37a17949240
diff --git a/docs/app/layout.tsx b/docs/app/layout.tsxindex a62dbbeb8..c7c0bb00c 100644--- a/docs/app/layout.tsx+++ b/docs/app/layout.tsx@@ -1,10 +1,10 @@import { RootProvider } from 'fumadocs-ui/provider/next';import type { Metadata } from 'next';-import Script from 'next/script';import { Analytics } from '@vercel/analytics/next';import './global.css';import { IBM_Plex_Mono } from 'next/font/google';import { PostHogProvider } from '@/components/posthog-provider';+import { DecimalWidget } from '@/components/decimal-widget';export const metadata: Metadata = {title: {@@ -103,12 +103,7 @@ export default function Layout({ children }: LayoutProps<'/'>) {{children}</RootProvider></PostHogProvider>- <Script- src="https://app.getdecimal.ai/widget/v1/widget.js"- data-widget-id="wgt_Ze0kCx97w7YXIydXpEAbAVWfu7FO6HG1"- data-public-config="eyJhbGciOiJIUzI1NiJ9.eyJ3aWQiOiJ3Z3RfWmUwa0N4OTd3N1lYSXlkWHBFQWJBVldmdTdGTzZIRzEiLCJkb21haW5zIjpbImNvbXBvc2lvLmRldiIsImNvbXBvc2lvLWRlY2ltYWwudmVyY2VsLmFwcCIsImxvY2FsaG9zdDozMDAwIiwiZG9jcy5jb21wb3Npby5kZXYiLCJmdW1hZG9jcy1wc2kudmVyY2VsLmFwcCJdLCJpYXQiOjE3Njk1MDE3NTZ9.j7odPAOmoKSkdkFHQCs7FDpAxHfJuzUOEMb_OuHi81I"- strategy="afterInteractive"- />+ <DecimalWidget /></body></html>);diff --git a/docs/components/decimal-widget.tsx b/docs/components/decimal-widget.tsxnew file mode 100644index 000000000..1cbcdb24c--- /dev/null+++ b/docs/components/decimal-widget.tsx@@ -0,0 +1,66 @@+'use client';++import Script from 'next/script';+import { useEffect, useState } from 'react';++type DecimalAPI = { theme: (config: Record<string, string>) => void };++const DARK_THEME = {+ colorScheme: 'dark',+ primaryColor: '#1e1d1c',+ backgroundColor: '#131211',+ textColor: '#FAFAFA',+ textColorSecondary: '#FFFFFF',+ textColorMuted: '#A1A1AA',+ borderColor: '#27272A',+};++const LIGHT_THEME = {+ colorScheme: 'light',+ primaryColor: '#171414',+ backgroundColor: '#ffffff',+ textColor: '#171414',+ textColorSecondary: '#ffffff',+ textColorMuted: '#5c5858',+ borderColor: '#e5e0df',+};++export function DecimalWidget() {+ const [scriptLoaded, setScriptLoaded] = useState(false);++ useEffect(() => {+ if (!scriptLoaded) return;++ const Decimal = (window as typeof window & { Decimal?: DecimalAPI }).Decimal;+ if (!Decimal) return;++ const applyTheme = () => {+ const isDark = document.documentElement.classList.contains('dark');+ Decimal.theme(isDark ? DARK_THEME : LIGHT_THEME);+ };++ applyTheme();++ const observer = new MutationObserver((mutations) => {+ for (const mutation of mutations) {+ if (mutation.attributeName === 'class') {+ applyTheme();+ }+ }+ });+ observer.observe(document.documentElement, { attributes: true });++ return () => observer.disconnect();+ }, [scriptLoaded]);++ return (+ <Script+ src="https://app.getdecimal.ai/widget/v1/widget.js"+ data-widget-id="wgt_Ze0kCx97w7YXIydXpEAbAVWfu7FO6HG1"+ data-public-config="eyJhbGciOiJIUzI1NiJ9.eyJ3aWQiOiJ3Z3RfWmUwa0N4OTd3N1lYSXlkWHBFQWJBVldmdTdGTzZIRzEiLCJkb21haW5zIjpbImNvbXBvc2lvLmRldiIsImNvbXBvc2lvLWRlY2ltYWwudmVyY2VsLmFwcCIsImxvY2FsaG9zdDozMDAwIiwiZG9jcy5jb21wb3Npby5kZXYiLCJmdW1hZG9jcy1wc2kudmVyY2VsLmFwcCJdLCJpYXQiOjE3Njk1MDE3NTZ9.j7odPAOmoKSkdkFHQCs7FDpAxHfJuzUOEMb_OuHi81I"+ data-display-mode="push-sidebar"+ strategy="afterInteractive"+ onLoad={() => setScriptLoaded(true)}+ />+ );+}diff --git a/docs/lib/layout.shared.tsx b/docs/lib/layout.shared.tsxindex 6d393468e..7b083d7e7 100644--- a/docs/lib/layout.shared.tsx+++ b/docs/lib/layout.shared.tsx@@ -1,5 +1,6 @@import type { BaseLayoutProps } from 'fumadocs-ui/layouts/shared';import Image from 'next/image';+import { Play } from 'lucide-react';// Composio Logo Component with light/dark mode switchingfunction ComposioLogo() {@@ -49,11 +50,6 @@ export function baseOptions(): BaseLayoutProps {url: '/reference',active: 'nested-url',},- {- text: 'Playground',- url: 'https://platform.composio.dev/auth?next_page=%2Ftool-router&utm_source=docs&utm_medium=navbar&utm_campaign=tool_router',- external: true,- },{text: 'Examples',url: '/examples',@@ -74,8 +70,13 @@ export function baseOptions(): BaseLayoutProps {},{type: 'button',- text: 'Dashboard',- url: 'https://platform.composio.dev',+ text: (+ <span className="inline-flex items-center gap-1.5">+ <Play className="size-4" style={{ color: 'var(--composio-orange)' }} />+ Playground+ </span>+ ),+ url: 'https://platform.composio.dev/auth?next_page=%2Ftool-router&utm_source=docs&utm_medium=navbar&utm_campaign=tool_router',external: true,secondary: true,},