-
Notifications
You must be signed in to change notification settings - Fork 9
/
options.tsx
53 lines (46 loc) · 2.42 KB
/
options.tsx
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
import "./globals.css"
import React, { useState } from "react"
import { useStorage } from "@plasmohq/storage/hook"
import OptionsAbout from "~options/OptionsAbout"
import OptionsGeneral from "~options/OptionsGeneral"
import OptionsHeader from "~options/OptionsHeader"
import OptionsMixtureOfAgents from "~options/OptionsMixtureOfAgents"
import OptionsPromptFactory from "~options/OptionsPromptFactory"
import OptionsSettings from "~options/OptionsSettings"
// ================================
// MAIN FUNCTION (OPTIONS)
// --------------------------------
export default function Options() {
const [activeTab, setActiveTab] = useStorage<string>("activeTab", "general")
return (
<div className="flex min-h-screen w-full flex-col">
<OptionsHeader></OptionsHeader>
<main className="flex min-h-[calc(100vh_-_theme(spacing.16))] flex-1 flex-col gap-4 bg-black p-4 md:gap-8 md:p-10">
<div className="mx-auto grid w-full max-w-6xl items-start gap-6 md:grid-cols-[180px_1fr] lg:grid-cols-[250px_1fr]">
<nav
className="grid gap-4 text-sm text-muted-foreground"
x-chunk="dashboard-04-chunk-0">
{["general", "promptFactory", "mixtureOfAgents", "settings", "about"].map(
(tab) => (
<div
key={tab}
id={tab}
className={` font-light text-xl cursor-pointer rounded-lg ${activeTab === tab ? "bg-black text-[#ff66cc] os-text-gradient" : "text-white"} shadow-md `}
onClick={() => setActiveTab(tab)}
>
{tab.charAt(0).toUpperCase() +
tab.slice(1).replace(/([A-Z])/g, " $1")}
</div>
)
)}
</nav>
{activeTab === "general" && <OptionsGeneral />}
{activeTab === "promptFactory" && <OptionsPromptFactory />}
{activeTab === "mixtureOfAgents" && <OptionsMixtureOfAgents />}
{activeTab === "settings" && <OptionsSettings />}
{activeTab === "about" && <OptionsAbout />}
</div>
</main>
</div>
)
}