"use client"; import { useState, useEffect } from "react"; import { Card, Button, Badge, Toggle } from "@/shared/components"; import { useTheme } from "@/shared/hooks/useTheme"; import { APP_CONFIG } from "@/shared/constants/config"; export default function ProfilePage() { const { theme, setTheme, isDark } = useTheme(); const [settings, setSettings] = useState({ fallbackStrategy: "fill-first" }); const [loading, setLoading] = useState(true); useEffect(() => { fetch("/api/settings") .then((res) => res.json()) .then((data) => { setSettings(data); setLoading(false); }) .catch((err) => { console.error("Failed to fetch settings:", err); setLoading(false); }); }, []); const updateFallbackStrategy = async (strategy) => { try { const res = await fetch("/api/settings", { method: "PATCH", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ fallbackStrategy: strategy }), }); if (res.ok) { setSettings(prev => ({ ...prev, fallbackStrategy: strategy })); } } catch (err) { console.error("Failed to update settings:", err); } }; return (
{/* Local Mode Info */}
computer

Local Mode

Running on your machine

All data is stored locally in the data/db.json file.

{/* Routing Preferences */}

Routing Strategy

Round Robin

Cycle through accounts to distribute load

updateFallbackStrategy(settings.fallbackStrategy === "round-robin" ? "fill-first" : "round-robin")} disabled={loading} />

{settings.fallbackStrategy === "round-robin" ? "Currently distributing requests across all available accounts." : "Currently using accounts in priority order (Fill First)."}

{/* Theme Preferences */}

Appearance

Dark Mode

Switch between light and dark themes

setTheme(isDark ? "light" : "dark")} />
{/* Theme Options */}
{["light", "dark", "system"].map((option) => ( ))}
{/* Data Management */}

Data

Database Location

~/9router/data/db.json

{/* App Info */}

{APP_CONFIG.name} v{APP_CONFIG.version}

Local Mode - All data stored on your machine

); }