"use client"; 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 { useConfig } from "@/hooks"; 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; if (stored) setTheme(stored); }, []); const toggleTheme = () => { const next = theme === "dark" ? "light" : "dark"; setTheme(next); localStorage.setItem("theme", next); document.documentElement.classList.remove("light", "dark"); document.documentElement.classList.add(next); }; 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 (
}, { 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
{statusLabel}
)} {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 ConfigRow({ label, value }: { label: string; value: string }) { return (
{label} {value}
); }