"use client"; import { Moon, Server, Shield, Sun, Wifi } from "lucide-react"; import { useEffect, useState } from "react"; 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"; export default function SettingsPage() { const { status } = useWebSocket(); const { config, loading: configLoading } = useConfig(); const [theme, setTheme] = useState<"light" | "dark">("dark"); 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 statusConfig = { 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", }, }[status]; return (
Connection
WebSocket {statusConfig.label}
{theme === "dark" ? ( ) : ( )} Appearance Server Configuration {configLoading ? ( ) : config ? (
) : (

Unable to load configuration.

)}
About

DC Automod — Discord Moderation Watcher

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

); } function ConfigRow({ label, value }: { label: string; value: string }) { return (
{label} {value}
); }