import { useState } from "react"; import { useTheme } from "../contexts/ThemeContext"; import { ProviderSettingsGrid } from "@/components/ProviderSettings"; import ConfirmationDialog from "@/components/ConfirmationDialog"; import { IpcClient } from "@/ipc/ipc_client"; import { showSuccess, showError } from "@/lib/toast"; import { AutoApproveSwitch } from "@/components/AutoApproveSwitch"; import { TelemetrySwitch } from "@/components/TelemetrySwitch"; import { MaxChatTurnsSelector } from "@/components/MaxChatTurnsSelector"; import { ThinkingBudgetSelector } from "@/components/ThinkingBudgetSelector"; import { useSettings } from "@/hooks/useSettings"; import { useAppVersion } from "@/hooks/useAppVersion"; import { Button } from "@/components/ui/button"; import { ArrowLeft } from "lucide-react"; import { useRouter } from "@tanstack/react-router"; import { GitHubIntegration } from "@/components/GitHubIntegration"; import { SupabaseIntegration } from "@/components/SupabaseIntegration"; import { Switch } from "@/components/ui/switch"; import { Label } from "@/components/ui/label"; export default function SettingsPage() { const { theme, setTheme } = useTheme(); const [isResetDialogOpen, setIsResetDialogOpen] = useState(false); const [isResetting, setIsResetting] = useState(false); const appVersion = useAppVersion(); const { settings, updateSettings } = useSettings(); const router = useRouter(); const handleResetEverything = async () => { setIsResetting(true); try { const ipcClient = IpcClient.getInstance(); await ipcClient.resetAll(); showSuccess("Successfully reset everything. Restart the application."); } catch (error) { console.error("Error resetting:", error); showError( error instanceof Error ? error.message : "An unknown error occurred", ); } finally { setIsResetting(false); setIsResetDialogOpen(false); } }; return (
File editing is not reliable and requires you to manually commit changes and update Supabase edge functions.
This will delete all your apps, chats, and settings. This action cannot be undone.