'use client' import { Check, Copy, ExternalLink } from 'lucide-react' import { usePathname } from 'next/navigation' import { useState } from 'react' import { isFeatureEnabled } from 'common' import { cn } from 'ui' import { ExpandableVideo } from 'ui-patterns/ExpandableVideo' import { Toc, TOCItems, TOCScrollArea } from 'ui-patterns/Toc' import { Feedback } from '~/components/Feedback' import { useTocAnchors } from '../features/docs/GuidesMdx.state' import { Chatgpt } from 'icons' import { Claude } from 'icons' interface TOCHeader { id?: string text: string link: string level: number } function AiTools({ className }: { className?: string }) { const [copied, setCopied] = useState(false) const path = usePathname() async function copyMarkdown() { const mdUrl = `/docs/${path}.md` try { const res = await fetch(mdUrl) const text = await res.text() await navigator.clipboard.writeText(text) setCopied(true) setTimeout(() => setCopied(false), 2000) } catch (error) { console.error('Failed to copy markdown', error) } } return (

AI Tools

Ask ChatGPT Ask Claude
) } const GuidesSidebar = ({ className, video, hideToc, }: { className?: string video?: string hideToc?: boolean }) => { const pathname = usePathname() const { toc } = useTocAnchors() const showFeedback = isFeatureEnabled('feedback:docs') const tocVideoPreview = `https://img.youtube.com/vi/${video}/0.jpg` return (
{video && (
)} {showFeedback && (
)}
{!hideToc && toc.length !== 0 && (

On this page

)}
) } export default GuidesSidebar export { GuidesSidebar } export type { TOCHeader }