aboutsummaryrefslogtreecommitdiffstats
path: root/renderer/src/components/SettingsPage.tsx
blob: 9ebde442a31ef8ca98b541e6a4c7bdeb903ff425 (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
import React, { useState } from "react";
import { SystemPromptsSettings } from "./settings/SystemPromptsSettings";
import { GitSettings } from "./settings/GitSettings";

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

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

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

  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 === "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 === "system-prompts" && <SystemPromptsSettings />}
          {activeSection === "git" && <GitSettings />}
        </div>
      </div>
    </div>
  );
}