import { useState, useEffect } 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 { 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"; export default function SettingsPage() { const { theme, setTheme } = useTheme(); const [isResetDialogOpen, setIsResetDialogOpen] = useState(false); const [isResetting, setIsResetting] = useState(false); const appVersion = useAppVersion(); const { settings } = useSettings(); const router = useRouter(); const handleResetEverything = async () => { setIsResetting(true); try { const ipcClient = IpcClient.getInstance(); const result = await ipcClient.resetAll(); if (result.success) { showSuccess("Successfully reset everything. Restart the application."); } else { showError(result.message || "Failed to reset everything."); } } catch (error) { console.error("Error resetting:", error); showError( error instanceof Error ? error.message : "An unknown error occurred" ); } finally { setIsResetting(false); setIsResetDialogOpen(false); } }; return (

Settings

{/* App Version Section */}
App Version: {appVersion ? appVersion : "-"}

General Settings

This will automatically approve code changes and run them.
{(["system", "light", "dark"] as const).map((option) => ( ))}

Telemetry

This records anonymous usage data to improve the product.
Telemetry ID: {settings ? settings.telemetryUserId : "n/a"}
{/* Integrations Section */}

Integrations

{/* Experiments Section */}

Experiments

There are no experiments currently available.
{/* Danger Zone */}

Danger Zone

Reset Everything

This will delete all your apps, chats, and settings. This action cannot be undone.

setIsResetDialogOpen(false)} />
); }