aethex-forge/client/components/TitleBar.tsx
sirpiglr a2805ea740 Add a fallback interface for when the 3D scene cannot be rendered
Updates Scene.tsx to include a fallback UI with realm selection when WebGL is not available, and fixes TypeScript errors in TitleBar.tsx.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 9203795e-937a-4306-b81d-b4d5c78c240e
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: 893e1048-aa5f-4dea-8907-56a7ccad680b
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/7c94b7a0-29c7-4f2e-94ef-44b2153872b7/9203795e-937a-4306-b81d-b4d5c78c240e/c8LGG4t
Replit-Helium-Checkpoint-Created: true
2025-12-05 22:22:25 +00:00

84 lines
2 KiB
TypeScript

import { useState, CSSProperties } from "react";
export default function TitleBar() {
const [pinned, setPinned] = useState(false);
const call = async (method: string) => {
const api = (window as any)?.aeBridge;
if (!api || !api[method]) return;
const res = await api[method]();
if (method === "togglePin") setPinned(res);
};
return (
<div
style={{
height: 36,
display: "flex",
alignItems: "center",
padding: "0 12px",
background: "#050814",
color: "#9ca3af",
// @ts-ignore - Electron-specific property
WebkitAppRegion: "drag",
borderBottom: "1px solid #0f172a",
letterSpacing: "0.08em",
fontSize: 12,
} as CSSProperties}
>
<div style={{ fontFamily: "Space Mono, monospace" }}>AeThex Terminal</div>
<div
style={{
marginLeft: "auto",
display: "flex",
gap: 8,
// @ts-ignore - Electron-specific property
WebkitAppRegion: "no-drag",
} as CSSProperties}
>
<button
onClick={() => call("togglePin")}
style={btnStyle(pinned ? "#38bdf8" : "#1f2937")}
title="Pin / Unpin"
>
{pinned ? "Pinned" : "Pin"}
</button>
<button
onClick={() => call("minimize")}
style={btnStyle("#1f2937")}
title="Minimize"
>
_
</button>
<button
onClick={() => call("maximize")}
style={btnStyle("#1f2937")}
title="Maximize / Restore"
>
</button>
<button
onClick={() => call("close")}
style={btnStyle("#ef4444")}
title="Close"
>
X
</button>
</div>
</div>
);
}
function btnStyle(bg: string) {
return {
border: "1px solid #111827",
background: bg,
color: "#e5e7eb",
borderRadius: 6,
padding: "4px 8px",
cursor: "pointer",
fontSize: 12,
minWidth: 46,
} as React.CSSProperties;
}