🎉 initial commit

This commit is contained in:
2026-02-20 14:17:34 +10:00
commit e21d1c7b58
33 changed files with 8207 additions and 0 deletions

47
src/renderer/App.tsx Normal file
View File

@@ -0,0 +1,47 @@
import { useEffect } from 'react'
import { FileTree } from './components/FileTree/FileTree'
import { MarkdownEditor } from './components/Editor/MarkdownEditor'
import { ChatPanel } from './components/AIChat/ChatPanel'
import { AnalysisToolbar } from './components/Toolbar/AnalysisToolbar'
import { useEditorStore } from './store/editorStore'
import './styles/app.css'
export default function App(): JSX.Element {
const { setFileTree, activeFilePath, isDirty, markSaved, activeFileContent } =
useEditorStore()
// Load file tree on mount
useEffect(() => {
window.api.listFiles().then(setFileTree)
}, [])
// Handle Cmd+S / Ctrl+S
useEffect(() => {
const handler = async (e: KeyboardEvent): Promise<void> => {
if ((e.metaKey || e.ctrlKey) && e.key === 's') {
e.preventDefault()
if (activeFilePath && isDirty) {
await window.api.writeFile(activeFilePath, activeFileContent)
markSaved()
}
}
}
window.addEventListener('keydown', handler)
return () => window.removeEventListener('keydown', handler)
}, [activeFilePath, isDirty, activeFileContent])
return (
<div className="app-layout">
<aside className="sidebar">
<FileTree />
</aside>
<main className="editor-area">
<AnalysisToolbar />
<MarkdownEditor />
</main>
<aside className="chat-area">
<ChatPanel />
</aside>
</div>
)
}