import { Label } from '@/components/ui/label'; import { Switch } from '@/components/ui/switch'; import { Code2 } from 'lucide-react'; import { cn } from '@/lib/utils'; import { useAppStore, type ServerLogLevel } from '@/store/app-store'; import { toast } from 'sonner'; const LOG_LEVEL_OPTIONS: { value: ServerLogLevel; label: string; description: string }[] = [ { value: 'error', label: 'Error', description: 'Only show error messages' }, { value: 'warn', label: 'Warning', description: 'Show warnings and errors' }, { value: 'info', label: 'Info', description: 'Show general information (default)' }, { value: 'debug', label: 'Debug', description: 'Show all messages including debug' }, ]; // Check if we're in development mode const IS_DEV = import.meta.env.DEV; export function DeveloperSection() { const { serverLogLevel, setServerLogLevel, enableRequestLogging, setEnableRequestLogging, showQueryDevtools, setShowQueryDevtools, } = useAppStore(); return (

Developer

Advanced settings for debugging and development.

{/* Server Log Level */}

Control the verbosity of API server logs. Set to "Error" to only see error messages in the server console.

{/* HTTP Request Logging */}

Log all HTTP requests (method, URL, status) to the server console.

{ setEnableRequestLogging(checked); toast.success(checked ? 'Request logging enabled' : 'Request logging disabled', { description: 'HTTP request logging updated', }); }} />
{/* React Query DevTools - only shown in development mode */} {IS_DEV && (

Show React Query DevTools panel in the bottom-right corner for debugging queries and cache.

{ setShowQueryDevtools(checked); toast.success(checked ? 'Query DevTools enabled' : 'Query DevTools disabled', { description: 'React Query DevTools visibility updated', }); }} />
)}
); }