diff --git a/services/frontend/src/app/(dashboard)/settings/page.tsx b/services/frontend/src/app/(dashboard)/settings/page.tsx index b01c861..9daead4 100644 --- a/services/frontend/src/app/(dashboard)/settings/page.tsx +++ b/services/frontend/src/app/(dashboard)/settings/page.tsx @@ -2,18 +2,21 @@ import { Moon, Server, Shield, Sun, Wifi } from "lucide-react"; import { useEffect, useState } from "react"; +import { GlassCard } from "@/components/glass/card"; +import { GlassDivider } from "@/components/glass/divider"; +import { SubNav } from "@/components/layout/sub-nav"; import { LoadingSkeleton } from "@/components/shared"; -import { Badge } from "@/components/ui/badge"; -import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; -import { Separator } from "@/components/ui/separator"; import { useConfig } from "@/hooks"; -import { cn } from "@/lib/utils"; import { useWebSocket } from "@/lib/ws/context"; +import { cn } from "@/lib/utils"; + +type SettingsTab = "connection" | "appearance" | "config" | "about"; export default function SettingsPage() { const { status } = useWebSocket(); const { data: config, isLoading: configLoading } = useConfig(); const [theme, setTheme] = useState<"light" | "dark">("dark"); + const [tab, setTab] = useState("connection"); useEffect(() => { const stored = localStorage.getItem("theme") as "light" | "dark" | null; @@ -28,147 +31,111 @@ export default function SettingsPage() { document.documentElement.classList.add(next); }; - const statusCfg = { - connected: { - label: "Connected", - variant: "default" as const, - dot: "bg-green-500 shadow-[0_0_6px] shadow-green-500/60", - }, - connecting: { - label: "Connecting", - variant: "secondary" as const, - dot: "bg-yellow-500 animate-pulse", - }, - disconnected: { - label: "Disconnected", - variant: "destructive" as const, - dot: "bg-destructive", - }, - error: { - label: "Error", - variant: "destructive" as const, - dot: "bg-destructive", - }, + const statusDot = { + connected: "bg-emerald-500 shadow-[0_0_8px] shadow-emerald-500/60 animate-pulse", + connecting: "bg-accent-amber animate-pulse", + disconnected: "bg-destructive", + error: "bg-destructive", + }[status]; + + const statusLabel = { + connected: "Connected", + connecting: "Connecting", + disconnected: "Disconnected", + error: "Error", }[status]; return ( -
- - - - Connection - - - +
+ }, + { id: "appearance", label: "Appearance", icon: }, + { id: "config", label: "Config", icon: }, + { id: "about", label: "About", icon: }, + ]} + activeTab={tab} + onTabChange={(t) => setTab(t as SettingsTab)} + /> + + {tab === "connection" && ( +
- WebSocket - - - {statusCfg.label} - -
- - - - - - - {theme === "dark" ? ( - - ) : ( - - )}{" "} - Appearance - - - - - - - - - - - Server Configuration - - - - {configLoading ? ( - - ) : config ? ( -
- - - - - - - - - +
+ WebSocket +
+
+ + {statusLabel}
- ) : ( -

- Unable to load configuration. -

- )} - - - - - - - About - - - -
-

- Discord Automod — - Discord Moderation Watcher -

-

- AI-powered message moderation, voice recording, and real-time - monitoring for Discord communities. -

-
-
+ + )} + + {tab === "appearance" && ( + +
+
+ {theme === "dark" ? : } + Theme +
+ +
+
+ )} + + {tab === "config" && ( + +
+ {configLoading ? ( + + ) : config ? ( + <> + + + + + + + + + + + ) : ( +

Unable to load config.

+ )} +
+
+ )} + + {tab === "about" && ( + +
+

Discord Automod

+

+ AI-powered message moderation, voice recording, and real-time monitoring for Discord communities. +

+
+ v0.1.0 +
+
+
+ )}
); } -function CfgRow({ label, value }: { label: string; value: string }) { +function ConfigRow({ label, value }: { label: string; value: string }) { return ( -
- {label} - - {value} - +
+ {label} + {value}
); }