aboutsummaryrefslogtreecommitdiffstats
path: root/renderer/src/components/SettingsPage.tsx
blob: 7d06547875deeae674612184b1aa9b05f71d6672 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
import React, { useState } from "react";
import { SystemPromptsSettings } from "./settings/SystemPromptsSettings";
import { GitSettings } from "./settings/GitSettings";
import { ModelSettings } from "./settings/ModelSettings";
import { McpSettings } from "./settings/McpSettings";

type SettingsSection = "model" | "mcp" | "system-prompts" | "git";

interface SettingsPageProps {
  onClose: () => void;
}

export function SettingsPage({ onClose }: SettingsPageProps) {
  const [activeSection, setActiveSection] =
    useState<SettingsSection>("model");

  return (
    <div className="settings-overlay">
      {/* Header — matches the main app header height/style */}
      <div className="settings-header">
        <div className="settings-header-left">
          <span className="settings-title">{'⚙'} Settings</span>
        </div>
        <button
          className="settings-close"
          onClick={onClose}
          title="Close settings"
        >
          {'×'}
        </button>
      </div>

      <div className="settings-body">
        {/* Side nav */}
        <nav className="settings-nav">
          <button
            className={`settings-nav-item${
              activeSection === "model" ? " active" : ""
            }`}
            onClick={() => setActiveSection("model")}
          >
            Model
          </button>
          <button
            className={`settings-nav-item${
              activeSection === "mcp" ? " active" : ""
            }`}
            onClick={() => setActiveSection("mcp")}
          >
            MCP Servers
          </button>
          <button
            className={`settings-nav-item${
              activeSection === "system-prompts" ? " active" : ""
            }`}
            onClick={() => setActiveSection("system-prompts")}
          >
            System Prompts
          </button>
          <button
            className={`settings-nav-item${
              activeSection === "git" ? " active" : ""
            }`}
            onClick={() => setActiveSection("git")}
          >
            Git
          </button>
        </nav>

        {/* Content */}
        <div className="settings-content">
          {activeSection === "model" && <ModelSettings />}
          {activeSection === "mcp" && <McpSettings />}
          {activeSection === "system-prompts" && <SystemPromptsSettings />}
          {activeSection === "git" && <GitSettings />}
        </div>
      </div>
    </div>
  );
}