'use client' import Sidebar from '../Sidebar/Sidebar' import TOC from '../TOC/TOC' import { useConfig } from 'nextra-theme-docs' import { usePathname } from 'next/navigation' import Link from 'next/link' import { PencilSimple } from '@phosphor-icons/react/dist/ssr' function Breadcrumb() { const config = useConfig() const { activePath } = config.normalizePagesResult if (!activePath || activePath.length <= 1) return null // Nextra emits both a folder entry and its index page with the same route // (e.g. /developers/migration appears twice once you open /developers/migration). // Collapse consecutive duplicates so React keys stay unique and the trail // does not show the same crumb twice. const trail = activePath.filter((item, i, arr) => { const next = arr[i + 1] return !next || next.route !== item.route }) return ( ) } function Pagination() { const config = useConfig() const { flatDocsDirectories, activeIndex } = config.normalizePagesResult const prev = activeIndex > 0 ? flatDocsDirectories[activeIndex - 1] : null const next = activeIndex < flatDocsDirectories.length - 1 ? flatDocsDirectories[activeIndex + 1] : null if (!prev && !next) return null return (
{prev ? ( Previous {typeof prev.title === 'string' ? prev.title : prev.name} ) :
} {next ? ( Next {typeof next.title === 'string' ? next.title : next.name} ) :
}
) } function EditOnGitHub({ filePath }) { // `filePath` comes from Nextra page metadata and is the actual source path // relative to the docs repo root (e.g. "content/cli/index.mdx"). Using it // directly avoids guessing folder-index vs leaf-file from the URL. if (!filePath) return null const href = `https://github.com/learnhouse/docs/edit/main/${filePath}` return ( Edit on GitHub ) } function LastEdited({ timestamp }) { if (!timestamp) return null const date = new Date(timestamp).toLocaleDateString('en-US', { month: 'short', day: 'numeric', year: 'numeric', }) return (
Last edited on {date}
) } function CloudAd() { return ( {/* Dot pattern background */}
LearnHouse Cloud

Try LearnHouse Cloud

Managed hosting with automatic updates, backups, and scaling.

Get started free
) } export default function Wrapper({ children, toc, metadata }) { const pathname = usePathname() const isHome = pathname === '/' return (
{!isHome && }
{children}
{!isHome && (
)}
{toc && toc.length > 0 && ( )}
) }