Files
cursor-byok/apps/desktop/src/layouts/AppHeader.tsx
T
leokun c5d578c5b1 feat(docs): add documentation site and demo features
- Introduced a new documentation site for Cursor BYOK using Next.js and Fumadocs.
- Added a product demo page with a corresponding Vite configuration.
- Implemented a demo API to simulate LLM calls and responses.
- Enhanced the Makefile to include new build and development commands for the documentation.
- Updated package.json scripts for building and running the documentation site.
- Created various components and layouts for the documentation structure, including blog and user documentation sections.
- Added styling for the new components and layouts to ensure a cohesive design.
- Included a README and other necessary files for local development and deployment.
2026-08-27 21:45:28 +08:00

41 lines
1.4 KiB
TypeScript

import { useEffect, useState } from "react";
import appIcon from "../../src-tauri/icons/32x32.png";
import { currentAppVersion } from "../native/appLifecycle";
import type { DesktopPlatform } from "../native/platform";
import { WindowControls } from "./WindowControls";
import { MacTrafficLights } from "./MacTrafficLights";
import styles from "./AppHeader.module.scss";
type AppHeaderProps = {
platform: DesktopPlatform;
nativeDesktop: boolean;
};
export function AppHeader({ platform, nativeDesktop }: AppHeaderProps) {
const showMacTrafficLights = !nativeDesktop && platform === "macos";
const showNativeUi = nativeDesktop && platform !== "macos";
const [version, setVersion] = useState("…");
useEffect(() => {
let disposed = false;
void currentAppVersion().then((next) => {
if (!disposed) setVersion(next);
});
return () => { disposed = true; };
}, []);
return <header className={styles.root}>
<div className={styles.dragLayer} data-tauri-drag-region aria-hidden="true" />
<div className={styles.uiLayer}>
{showMacTrafficLights && <MacTrafficLights />}
{showNativeUi && <>
<div className={styles.identity} aria-label="Cursor BYOK">
<img src={appIcon} alt="" />
<span>{t("Cursor 助手 v{version}", { version })}</span>
</div>
<WindowControls />
</>}
</div>
</header>;
}