tabs
This commit is contained in:
parent
a8555efc28
commit
64bf9cfea0
1 changed files with 50 additions and 8 deletions
|
|
@ -1,3 +1,4 @@
|
|||
import { useState } from "react";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import PageHeader from "../../components/PageHeader";
|
||||
import { useNavigationListener } from "../../hooks/useNavigationListener";
|
||||
|
|
@ -5,15 +6,44 @@ import { AccountButton } from "./AccountButton";
|
|||
import { HelpCenterSection } from "./HelpCenterSection";
|
||||
import { IndexingSettingsSection } from "./IndexingSettingsSection";
|
||||
import KeyboardShortcuts from "./KeyboardShortcuts";
|
||||
import MCPServersPreview from "./MCPServersPreview";
|
||||
import { UserSettingsForm } from "./UserSettingsForm";
|
||||
|
||||
type TabOption = {
|
||||
id: string;
|
||||
label: string;
|
||||
component: React.ReactNode;
|
||||
};
|
||||
|
||||
function ConfigPage() {
|
||||
useNavigationListener();
|
||||
const navigate = useNavigate();
|
||||
const [activeTab, setActiveTab] = useState("general");
|
||||
|
||||
const tabs: TabOption[] = [
|
||||
{
|
||||
id: "general",
|
||||
label: "General",
|
||||
component: <UserSettingsForm />,
|
||||
},
|
||||
{
|
||||
id: "indexing",
|
||||
label: "Indexing",
|
||||
component: <IndexingSettingsSection />,
|
||||
},
|
||||
{
|
||||
id: "help",
|
||||
label: "Help Center",
|
||||
component: <HelpCenterSection />,
|
||||
},
|
||||
{
|
||||
id: "shortcuts",
|
||||
label: "Shortcuts",
|
||||
component: <KeyboardShortcuts />,
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<div className="overflow-y-scroll">
|
||||
<div className="flex h-full flex-col overflow-y-scroll">
|
||||
<PageHeader
|
||||
showBorder
|
||||
onTitleClick={() => navigate("/")}
|
||||
|
|
@ -21,12 +51,24 @@ function ConfigPage() {
|
|||
rightContent={<AccountButton />}
|
||||
/>
|
||||
|
||||
<div className="px-4">
|
||||
<UserSettingsForm />
|
||||
<IndexingSettingsSection />
|
||||
<MCPServersPreview />
|
||||
<HelpCenterSection />
|
||||
<KeyboardShortcuts />
|
||||
<div className="flex flex-1 flex-col">
|
||||
{/* Tab Headers */}
|
||||
<div className="flex w-full justify-center">
|
||||
{tabs.map((tab) => (
|
||||
<div
|
||||
key={tab.id}
|
||||
className={`px-4 py-2`}
|
||||
onClick={() => setActiveTab(tab.id)}
|
||||
>
|
||||
{tab.label}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
|
||||
{/* Tab Content */}
|
||||
<div className="flex-1 p-4">
|
||||
{tabs.find((tab) => tab.id === activeTab)?.component}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue