import { useState, useEffect } from 'react'; import { FileText, Box, FolderOpen } from 'lucide-react'; import { ApiDocViewer } from './components/ApiDocViewer'; import BlueprintPage from './components/blueprint/BlueprintPage'; import { config } from './config'; type Page = 'docs' | 'blueprint'; declare global { interface Window { electronAPI?: { selectFolder: () => Promise; getDocsPath: () => Promise; onDocsPathChanged: (callback: (path: string) => void) => void; }; } } function App() { const [currentPage, setCurrentPage] = useState('docs'); const [docsPath, setDocsPath] = useState(''); useEffect(() => { document.title = config.projectName; if (window.electronAPI) { window.electronAPI.getDocsPath().then(setDocsPath); window.electronAPI.onDocsPathChanged(setDocsPath); } }, []); const handleSelectFolder = async () => { if (window.electronAPI) { const path = await window.electronAPI.selectFolder(); if (path) { setDocsPath(path); } } }; return (

{config.projectName}

{docsPath && ( 📁 {docsPath} )}
{window.electronAPI && ( )}
{currentPage === 'docs' ? : }
); } export default App;