mirror of
https://github.com/OpenHands/OpenHands.git
synced 2025-12-26 05:48:36 +08:00
* Add formatting and linting for typescript components * Add lint GitHub Action * Add push to GitHub action trigger * Update GitHub action node version * Add Husky * Update husky settings * Fix Husky settings * Should not pass * Test * Test * Finalize * Add --legacy-peer-deps flag to npm ci * Fix lint pre-commit hook * Compile * Remove eslint and prettier command quotes
42 lines
1.1 KiB
TypeScript
42 lines
1.1 KiB
TypeScript
// App.tsx
|
|
import React, { useState } from "react";
|
|
import "./App.css";
|
|
import ChatInterface from "./components/ChatInterface";
|
|
import Terminal from "./components/Terminal";
|
|
import Planner from "./components/Planner";
|
|
|
|
function App(): JSX.Element {
|
|
const [activeTab, setActiveTab] = useState<"terminal" | "planner">(
|
|
"terminal",
|
|
);
|
|
|
|
return (
|
|
<div className="app">
|
|
<div className="left-pane">
|
|
<ChatInterface />
|
|
</div>
|
|
<div className="right-pane">
|
|
<div className="tab-container">
|
|
<div
|
|
className={`tab ${activeTab === "terminal" ? "active" : ""}`}
|
|
onClick={() => setActiveTab("terminal")}
|
|
>
|
|
Shell
|
|
</div>
|
|
<div
|
|
className={`tab ${activeTab === "planner" ? "active" : ""}`}
|
|
onClick={() => setActiveTab("planner")}
|
|
>
|
|
Planner
|
|
</div>
|
|
</div>
|
|
<div className="tab-content">
|
|
{activeTab === "terminal" ? <Terminal /> : <Planner />}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
export default App;
|