continue-custom/docs-site/components/docs/mdx/OSAutoDetect.tsx
Nate 606fba91a3 feat: add docs site as static Next.js export
Migrates the docs site from remote-config-server to this repo as a
standalone static Next.js app. Key changes:

- Copy app-docs from remote-config-server to docs-site/
- Configure `output: 'export'` for static HTML generation
- Replace API routes with build-time scripts (search index, image copy)
- Add generateStaticParams() to enumerate all doc slugs at build time
- Convert server-side redirects to client-side redirects
- Point DOCS_DIR to sibling ../docs directory
- Add GitHub Actions workflow for deploying to GitHub Pages
- Add missing Radix UI dependencies (accordion, tabs) to package.json

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 13:52:25 -07:00

25 lines
609 B
TypeScript

"use client";
import { useEffect } from "react";
export function OSAutoDetect() {
useEffect(() => {
const ua = navigator.userAgent.toLowerCase();
const isWindows = ua.includes("win");
const isMac = ua.includes("mac");
const isLinux = ua.includes("linux");
let tabIndex = 2; // default: npm
if (isMac || isLinux) tabIndex = 0;
else if (isWindows) tabIndex = 1;
const tabButtons = document.querySelectorAll(
'[role="tablist"] button',
);
if (tabButtons[tabIndex]) {
(tabButtons[tabIndex] as HTMLButtonElement).click();
}
}, []);
return null;
}